[thelist] Javacript onSubmit help

darren darren at web-bitch.co.uk
Thu Feb 21 11:35:01 CST 2002


On 21 February 2002 at 17:22:55, Feingold Josh S <Josh.S.Feingold at irs.gov> wrote:

FJS> I am trying to get a simple script to work, but I seem to be doing something
FJS> wrong.  A few weeks back I posed the question of how to ensure that a
FJS> browers only submit when the user hits the submit button.

FJS> However, the script does not seem to be working.  Any suggestions?

i've had the same problem.  what i found was that in the later versions of
ie, not sure about any others, hitting return seems to fire the onclick
event, which sets your variable to true.  i'm pretty sure this didn't use
to happen though.

anyway, one method could be to set the variable in the onMouseOver event so
the mouse has to be over the button and clicked for it to work.  don't
forget to set this to false in the onMouseOut.

i'm sure one of the js gods will be along shortly to put me right! :>

hth,

darren.




More information about the thelist mailing list