Stats: 3,186,270 members, 7,928,889 topics. Date: Friday, 23 August 2024 at 02:25 AM |
Nairaland Forum / Science/Technology / Webmasters / Text Fields With Limited Chracters (643 Views)
Two-way SMS Text Verification/product Activation Using Long Code (Tutorial) / Problem: Centering Text Using Php's Imagettftext / How To Select All The Fields From A Mysql Table And Access The Data Individually (2) (3) (4)
Text Fields With Limited Chracters by DrAyo1(m): 10:02pm On Oct 13, 2009 |
I was on a page building a form, and I will like to limit the characters that can be entered in the text field. That is when the user is typing in the browser and the characters reach the limit (I chose) he won't be able to type anything more. Also, how would I prevent some characters like #. @ etc in the text field. Thanks. |
Re: Text Fields With Limited Chracters by wizzykid(m): 10:40pm On Oct 13, 2009 |
which package do u use? dreamweaver? |
Re: Text Fields With Limited Chracters by OmniPotens(m): 12:18am On Oct 14, 2009 |
@Dr. Ayo: Have you learnt about "maxlength" in text fields before? If not go learn about maxlength. You use that to special the maximun number of character allowed in a text field. As for the special characters elimination, why not use PHP to strip those things off. I'll still fix up something in case I can lay my hand at one. |
Re: Text Fields With Limited Chracters by OmniPotens(m): 12:36am On Oct 14, 2009 |
Try using this Javascript regular expressions to see if it will work <script language="JavaScript"><!-- |
Re: Text Fields With Limited Chracters by lightwalk(m): 1:01am On Oct 14, 2009 |
That's very easy to do in ASP.NET You can check out codeproject.com |
Re: Text Fields With Limited Chracters by xanadu: 7:30am On Oct 14, 2009 |
@Dr Ayo, I am presuming you mean restricting text entered in a textarea? I am not quite sure that the 'maxlength' attribute is supported for textarea fields (it supports the 'columns', 'rows' and 'name' attributes). It is supported in text fields. For textareas, you can still use the maxlength attribute but with some Javascript help. Check this web page out for a sample script that should make this clearer: http://www.dynamicdrive.com/dynamicindex16/maxlength.htm Hope that helps. |
Re: Text Fields With Limited Chracters by DrAyo1(m): 10:57am On Oct 15, 2009 |
Thanks everyone for your reply. @Xanadu: I followed your reference to dynamicdrive and it helped Thanks Omnipotence for the script. |
(1) (Reply)
Webmasters Pls Help-out / 15000 Articles For You Now: / Need A Sales Page?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9 |