View Full Version : onSubmit problems!!!
ztheged
09-04-2002, 08:47 PM
Hey
I have some problems with the onSubmit event handling in a FORM header. What I wanna do it have the form run multiple events, as you can see in the script below:
<form name="dform" action="../scripts/formmail.asp" method="post" onsubmit="return dform_Validator(this)";"return verify(this.Password, this.Password2)" language="JavaScript">
I have tried everything as to how to connect them, into one onSubmit label, but nothing seems to work!
The goal is to make a double-password validator AND field validator run when submitting.
Probably very simple solution, so please please help if you know the answer! Thanks :confused:
c1lonewolf
09-04-2002, 09:06 PM
I've been playing around with a few e-mail forms lately one allows you to mail to any one with any subject.
It's almost like you script except the problem I had with it was the action conflicting with the on submit functions.
My action was mailing to me evrytime and my submit function was being called from the head.
try taking out the action=" ?asp." and code your other function from the head.
I'm not a scripter but I do modify them enough to make the tweaks happen. Put your validations in head and onsumit="validate()" then you button should be onclick="javascript:validate()"
something like that hope this helps a little.
redhead
09-04-2002, 09:12 PM
erm... ive highlighted the problem:
<form name="dform" action="../scripts/formmail.asp" method="post" onsubmit="return dform_Validator(this)";"return verify(this.Password, this.Password2)" language="JavaScript">
heres the correct code:
<form name="dform" action="../scripts/formmail.asp" method="post" onsubmit="return dform_Validator(this); return verify(this.Password, this.Password2)">
your using this script (http://www.javascriptkit.com/script/script2/verifyfield.shtml) for the double enter form, eh?
hope that helps...
whackaxe
09-04-2002, 09:14 PM
little problems
onsubmit="return dform_Validator(this)";"return verify(this.Password, this.Password2)" language="JavaScript">
take out the language="javascript" (javascript is the default script and i dont thin that the form tag takes thatargument and the
return dform_Validator(this) ; return verify(this.Password, this.Password2)
take out the " around the ; becasue theres no need
ztheged
09-04-2002, 09:37 PM
hi Guys!
Thanks indeed for your help
Its working perfectly now, but it turned out to be a bi-directional problem. From one side the script was incorrect with the " marks, and from the other side it seems that MS FrontPage 2002 tends to generate its own code for the onSubmit events when publishing with its built-in validator.. quite frankly deletes anything you write in..
Had to work around that, but now its working fine! Appreciate your help again!
Cheers :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.