HTML forms: validate form before submitting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jain236
    New Member
    • Jul 2007
    • 36

    HTML forms: validate form before submitting

    Hi every all,

    i have a small doubt about the form tag in html. i have html page which has 2 select button, and one text box.
    i have a submit button whicn on clicking it is calling inven.cgi.when i click it is going to new page , instead of that first i want to validate the select button and text box if nothing is selected then it should not go to the inven.cgi.

    <FORM METHOD=POST ACTION="inven.c gi" >

    thanking you in advance
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    you may check the form-values with some simple javascript by using the form's onsubmit-handler that calls the validation function(s) and returns true or false depending to the validation ...

    kind regards

    Comment

    • josefdesousa
      New Member
      • Jul 2008
      • 9

      #3
      Hi dude,
      Please write jave script using call the function using onclick function!
      hope you got it.

      Regards
      jose

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Moved to the JavaScript forum.

        Comment

        Working...