View Full Version : Form submit when textfield is full??

09-25-2005, 07:02 PM
Greetings to all,

After searching high and low, I can't find a script example I *know* I've seen before - that being a way to automatically submit a form when a texfield has reached "X" characters length.

In this case X needs to be nine numeric characters but I can filter for alpha easily enough.

Anyway, any help, links or suggestions on this frustrating problem would be greatly appreciated!! :thumbsup:

Thanks in advance!

09-25-2005, 07:08 PM

09-25-2005, 07:29 PM
A 6 minute response!?! WOW! -Dude, you rock! Thanks for the VERY fast response rm-f :thumbsup:

I continued tinkering with the code I was trying to use, using onkeypress() , and managed to get it to work! - When I came back to post it I saw that you'd gotten here first :cool:

Anyway, here's the exact code I'm using - hopefully it will be helpful for anyone else trying to auto submit a form based on textfield length:

function textSubmit(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))

<form name="myForm" action="processForm.asp" method="post">
<input type="text" name="first" size=12 onKeyup="textSubmit(this, document.myForm.second)" maxlength=9>