![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
neither is working but am concentrating now just for onreset here is the code for both: FORM onSubmit=" this.firstname.optional=true; this.lastname.optional=true; this.addr1.optional=true; this.city.optional=true; this.state.optional=true; this.zip.min=0; this.zip.max=99999; this.homephone.optional=true; this.email.optional=true; return verify(this); " onreset = return confirm("do you really want to erase everything entered and start over from scratch?"); then the code for the reset button input type="SUBMIT" value="Submit Volunteer Information"> <input type="RESET" value="Start Over" basically the web page just flashes when i click the reset and submit buttons once i get the basic reset going then i will finish up on the verifications am i missing some really basic coding here?? |
#3
| |||
| |||
|
|
Lee wrote on 26 jul 2003 in comp.lang.javascript: onreset = "return confirm('do you really want to erase everything entered and start over from scratch?');" The value of the onreset attribute has to be in quotes. The argument to confirm should be all on one line. bit OT: It is quite possible to have the source on more lines: div onclick = "alert('Result is: '+ confirm('Do you understand that'+ 'not all this text\nhas to be on one line ?'));" click me</div -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
#4
| |||
| |||
|
|
bbxrider wrote on 27 jul 2003 in comp.lang.javascript: thanks evertjan, for the clarfiication, but why did you enclose your example within the <div and change it to onclick..... To make it easily testable in test.html. This [my answer] was about the multilineability syntax of a string, not about form reset buttons. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
#5
| |||
| |||
|
|
any ideas on making onsubmit work? 1. does onsubmit within the form tags work at all? this doesn't work and i've seen postings that it will never work FORM method="Post" action="phsVolunteerData.asp" onsubmit=" alert('just testing to get onsubmit code to get invoked'); " 2. i am now trying this but does not work either input type="button" value="submit" onClick="verify(this.form)" script verify(f) } |
|
alert('just testing to get onsubmit code to get invoked'); ..........lots of verification code return; } does it matter where the javascript code is placed within the html code?? |
#6
| |||
| |||
|
|
bbxrider wrote on 27 jul 2003 in comp.lang.javascript: any ideas on making onsubmit work? 1. does onsubmit within the form tags work at all? this doesn't work and i've seen postings that it will never work FORM method="Post" action="phsVolunteerData.asp" onsubmit=" alert('just testing to get onsubmit code to get invoked'); " 2. i am now trying this but does not work either input type="button" value="submit" onClick="verify(this.form)" script verify(f) } wrong one, should be { alert('just testing to get onsubmit code to get invoked'); ..........lots of verification code return; } does it matter where the javascript code is placed within the html code?? This should work: FORM method="Post" action="phsVolunteerData.asp" onsubmit="alert('testing onsubmit');return true;" and this: FORM method="Post" action="phsVolunteerData.asp" onsubmit="alert('testing onsubmit');this.submit();return false;" and this: form .... input type="button" value="submit" onClick="return verify(this.form);" verify(f) { alert('just testing'); if (verifiedOK)f.submit(); return false; } and this: form .... input type="button" value="submit" onClick="return verify(this.form);" verify(f) { alert('just testing'); return (verifiedOK); } not tested -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |
![]() |
| Thread Tools | |
| Display Modes | |
| |