CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • PraveenKumar Purushothaman

    MemberJul 12, 2011

    What do you exactly want to know? Can you please be elaborate?
    Are you sure? This action cannot be undone.
    Cancel
  • moorvidya

    MemberJul 26, 2011

    Hi..i provide simple text field validation using JavaScript,

    <html>
    <head>

    <script type='text/javascript'> function formValidator()
    { // Make quick references to our fields var firstname = document.getElementById('firstname');

    if(isAlphabet(firstname, "Please enter only letters for your name"))
    {
    return true;
    }
    return false;
    }

    function notEmpty(elem, helperMsg)
    {
    if(elem.value.length == 0)
    {
    alert(helperMsg);
    elem.focus(); // set the focus to this input
    return false;
    }
    return true;
    }

    </script>

    </head>
    <body>

    <form onsubmit='return formValidator()' >
    First Name: <input type='text' id='firstname' />

    <input type='submit' value='Check Form' />
    </form>

    </body>
    </html>


    ------------------
    link removed
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJul 27, 2011

    moorvidya
    Hi..i provide simple text field validation using JavaScript,

    <html>
    <head>

    <script type='text/javascript'> function formValidator()
    { // Make quick references to our fields var firstname = document.getElementById('firstname');

    if(isAlphabet(firstname, "Please enter only letters for your name"))
    {
    return true;
    }
    return false;
    }

    function notEmpty(elem, helperMsg)
    {
    if(elem.value.length == 0)
    {
    alert(helperMsg);
    elem.focus(); // set the focus to this input
    return false;
    }
    return true;
    }

    </script>

    </head>
    <body>

    <form onsubmit='return formValidator()' >
    First Name: <input type='text' id='firstname' />

    <input type='submit' value='Check Form' />
    </form>

    </body>
    </html>
    @Moorvidya: Please explain me these things:
    1. Where is the function isAlphabet been defined?
    2. Where is firstname defined? (It is already commented out!)
    3. Where is notEmpty() function called?
    4. Why have you placed a link to an irrelevant website?

    If you are qualified, please respond to the post. The reply you have given, copied from tizag, that too not fully, is a BS. Please don't spam a place where you are not supposed to spam! 😲 Make sure this is not happening again.

    @Sanjay: Please say the fields in your form and which are need to be validated. Thanks.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register