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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    validating form! errors

    Hi there

    I posted a post earlier on but cannot find it can anyone help me pls?

    I have this code but it is giving error messages ....

    I have to authenticate a page where the user is expected to enter a unique 10 character pin consisting of numbers and letters only in fact among its xters it should have at least 3 digits and at least 5 captial letters , mixed in any order.otherwise it is not valid.

    first it is not coming up with any errors but it is not validating the form :

    It traps "pls enter ur pin" and then jumps to the vote page. Which should not be the case without the "validating empty form" and I try to valdate for pin no errors but it jumps thru to the voting page which is wrong?

    How ever now I have added the code to trap pin not less than or more than 10 xters
    it has some erros of "object expected" I have indicated the line below:

    "also I have added to trap if pin is less than or greater digits"


    I have reposted ur code but modified to suit my problem below :


    <Script Language=JavaScript>


    function validate(thisform) {
    {
    //check pin
    if (document.forms[0].elements[0].value =="")

    alert ("please enter your pin!");
    return false;
    }

    //check pin
    if (document.forms[0].elements[0].value < 10 || > 10)

    alert ("please the pin is the wrong length");
    return false;
    }
    }

    if ((document.thisform.pin.value.search(/[0-9]+/)) == -3) {
    window.alert("The pin must contain at least three NUMBER.");
    return false;

    }

    if ((document.thisform.pin.value.search(/(A-Z)+/)) == -5) {
    window.alert("The pin must contain at least five LETTER.");
    return false;



    }
    }
    <form name="thisform" method="post" action="voting.php" onSubmit="validate(thisform)">
    <td width="144"><input name="pin" type="text" id="pin"></td><td width="135"><font size="1" face="Arial, Helvetica, sans-serif">
    <input type="submit" name="Submitform" value="Click to proceed">

    </Script>

    Pls can someone tell me what I am doing wrong/ help me out. Also pls what is the meaning of "OBJECT expected"..this is one error meassge that shows up and it points to this line "onSubmit="validate(thisform)">

    I would be very grateful for this help.

    Many Thanks.


    __________________
    Many Thanks
    capridv

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I answered this question in your other thread. Ask a moderator to move your other thread, don't start a new one.

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am very sorry for that new thread I just could not find the earlier thraed , after much search. I just assumed that maybe I did not actually send it......sometimes these things happen.

    My sincere apology.I would let d moderator know... but I need to find it first.

    Thanks

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

    Pls! help me find my POST!

    Hi there

    I am new on this forum and I have posted a post which after searching for over 30mins I assumed that I did not post it even though I know I did and the forum reply said it has received my post. I posted another POST and as a member hemebond has pointed out this message he or she did reply to.

    I initially used the "search forum" to find it but to no avail. and also have done the same now a member said they replied to it since to no avail.

    and also was wandering if the forum has a place like all my posts and the replies so I can view it pls.

    Pls can someone help.

    Many Thanks.

  • #5
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    ahhh the punishment for double posting lol..(just a joke)http://www.codingforums.com/showthread.php?t=50154
    Just do a search by your username to find all of your posts...or click on your username...
    http://www.codingforums.com/search.php?searchid=163327

  • #6
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Brandoe85 I found the message

    Many Thanks


  •  

    Posting Permissions

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