Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Jul 12, 2011

    What do you exactly want to know? Can you please be elaborate?

  • moorvidya

    @moorvidya-4LE4Hi • Jul 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

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Jul 27, 2011

    moorvidyaHi..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.