...

Very nice form effect

jscript_junkie
08-10-2002, 03:53 PM
I found a script on Dynamic Drive that allows you to restrict how many characters can be entered into a form field. Very useful if asking for state abreviations, phone numbers, zip codes, etc.

In addition, it also tells the user how many characters they have left to type! Very nice.

http://www.dynamicdrive.com/dynamicindex16/limitinput.htm

<edit my="post" />
To add to this, there is also a form validation page which allows very strict restraints. Example, if asking for a favorite radio station, it will require the data to be in the ##.# number format. Another nice script.

http://www.peterbailey.net/jsdemo/

nolachrymose
08-10-2002, 06:04 PM
Could you just use the maxlength attribute of a field to limit the amount of input?

<input type="text" name="state" maxlength="2" />

Happy coding! :)

jscript_junkie
08-10-2002, 07:42 PM
That's what I was thinking, too. This script would be better if it just included how many characters left and use your above method to restrict length.

My username for this service contradicts itself. I'm not a pro at JavaScript. I can just cut and paste. I only registered jscript_junkie because javascript_junkie was too long. I had that name on the old forum, though. I just like my username because it sounds cool. :D

Maybe some of our JavaScript experts can put together a script that would fit the above descriptions. ;)

WA
08-10-2002, 10:54 PM
Doesn't maxlength only work with INPUT, and not TEXTAREA?

jscript_junkie
08-11-2002, 03:45 AM
Yeah, I think so. So, JavaScript would definetly be needed there. Not sure how to do that, though.

document.forms.maxlength... Something like that.

This is a nice script, but could use some tweaking.

redhead
08-19-2002, 09:40 PM
hmms... maybe something like whammys?

http://www.codingforums.com/showthread.php?s=&threadid=2224

jscript_junkie
08-20-2002, 12:10 AM
It seems OK. I don't know the first thing about JavaScript. The things that I did understand looked very good. :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum