#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    12
    Rep Power
    0

    HTML (Form) Validation


    I want to apply validation on my html textbox with java how i can make or create validates on form give me any idea.

    regards.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Location
    Saint-Petersburg, Russia
    Posts
    236
    Rep Power
    28
    Idea is simple - you should get the value entered into your input box, check whether it is correct (whether it is number, or date etc) and add error message if not.

    However, at first you are to check, whether you are talking about java or javascript.

    In javascript you can add your validator to "onchange" event of the input. With java you need to provide far more info about your system, since java is working on server, not in browser.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    12
    Rep Power
    0

    Post Register form validation


    hy every,

    dear all friends i want to make my registeration form with all validation and events. Please help me to make that such type of forms that i want to apply validation

    thanx
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Location
    Saint-Petersburg, Russia
    Posts
    236
    Rep Power
    28
    It looks you are not willing to answer question about java or javascript.

    Here are some examples:
    http://www.w3schools.com/js/js_form_validation.asp
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    27
    Rep Power
    0
    Try out with the below example, i have used it before.
    NUMBER VALIDATION:
    <script type="text/javascript">
    function numbersonly(e){
    var unicode=e.charCode? e.charCode : e.keyCode
    if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
    if (unicode<48||unicode>57) //if not a number
    return false //disable key press
    }
    }
    </script>

    <form>
    <input type="text" size=18 onkeypress="return numbersonly(event)">
    </form>

    Limit number of characters allowed:

    <script type="text/javascript">

    function limitlength(obj, length){
    var maxlength=length
    if (obj.value.length>maxlength)
    obj.value=obj.value.substring(0, maxlength)
    }

    </script>

    Enter text (max length is 20 characters):
    <form>
    <textarea onkeyup="return limitlength(this, 20)" style="width: 300px; height: 90px"></textarea>
    </form>

    Hope this helps.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    12
    Rep Power
    0

    Validation for textboxes


    hy
    i am looking for i want to apply validation for registertation for by using html and java script so any one tell me how i can do this..
    and share please some solid tuterial for this task..

    thnxxx
  12. #7
  13. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4303
    Check these out:
    http://www.quirksmode.org/js/forms.html
    http://jibbering.com/faq/notes/form-access/
    http://www.javascriptkit.com/javatutors/form6.shtml
    http://www.javascriptkit.com/javatutors/valid3.shtml

    P.S. This is a JavaScript question. Please post such questions in the JavaScript forum.

    *** Thread Moved (and merged with related thread) ***
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  14. #8
  15. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1045
    That guy or gal does nothing but repeat the same question despite getting several links and suggestions. I doubt this is a serious request.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo