Om de ûnderfining foar jo te ferbetterjen is tydlik de funksjonaliteit dan dizze website troch ûnderhâldswurk beheind. Wannear in artikel jo probleem net oplost en jo in fraach stelle wolle, kin ús stipemienskip jo helpe yn @FirefoxSupport op Twitter en /r/firefox op Reddit.

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Mear ynfo

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

In a javascript function invoked from an onsubmit handler, if the function returns false, the form is still submitted. If I find an error in a form, how do I cancel the submit?

  • 3 antwurd
  • 1 hat dit probleem
  • 10 werjeftes
  • Lêste antwurd fan AnonymousUser

more options

HTML form has: action="/TTFFRP/addlicense.rex" method="get" onsubmit="validate_data();"

validate_data is defined in tags:

function validate_data()

 {                                                                                                    
   alert('in validate routine');                                                                      
   if (document.getElementById('custname').value == )                                               
     {                                                                                                
      alert('Customer name must not be blank; put in name of organization licensing File RePackager');
      return false;                                                                                   
     }                                                                                                                                         

}

HTML form has: action="/TTFFRP/addlicense.rex" method="get" onsubmit="validate_data();" validate_data is defined in tags: function validate_data() { alert('in validate routine'); if (document.getElementById('custname').value == '') { alert('Customer name must not be blank; put in name of organization licensing File RePackager'); return false; } }

Alle antwurden (3)

more options

I have the exactly same problem

more options

Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. http://forums.mozillazine.org/viewforum.php?f=25 You'll need to register and login to be able to post in that forum.

more options

Make the onsubmit handler say "return validate_data();" so:



works!