Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Form submit when textfield is full??

    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!!

    Thanks in advance!
    AftrBrnr

  • #2
    Regular Coder
    Join Date
    Aug 2005
    Location
    Toronto, ON, Canada
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onkeypress()
    rm -f /

  • #3
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks!

    A 6 minute response!?! WOW! -Dude, you rock! Thanks for the VERY fast response rm-f

    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

    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:

    Code:
    <script>
    function textSubmit(original,destination){
    if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
    document.myForm.submit();
    }
    </script>
    
    <form name="myForm" action="processForm.asp" method="post">
    <input type="text" name="first" size=12 onKeyup="textSubmit(this, document.myForm.second)" maxlength=9>
    </form>
    Cheers!
    AftrBrnr


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •