Connecting Tech Pros Worldwide Forums | Help | Site Map

Javascript onsubmit() doesn't fire WTF?

Newbie
 
Join Date: May 2007
Posts: 1
#1: May 24 '07
I was kind of expecting to see a "test" message pop up when I clicked the submit button, but NNNNOOOOOOOOOOO! wtf gives?

<form method="post" onsubmit="javascript:window.alert('test');" action="http://www.botworks.com/local/BWIForm.pl" target=_blank name="BWIForm" >
<input type=hidden name="BWI_last_mode" value="review">
<input type=hidden name="BWI_action" value="Search">
<select name="BWI_table_name">
<option value="book">book
<option value="Content">Content
... lots more options here...
<option value="UserClass">UserClass
<option value="VolunteerProfile">VolunteerProfile
</select>
<input type=submit value="ReFORM&trade;">
</form>

iam_clint's Avatar
Forum Leader
 
Join Date: Jul 2006
Location: Oklahoma
Posts: 1,076
#2: May 24 '07

re: Javascript onsubmit() doesn't fire WTF?


<form onbeforesubmit="alert('test');">
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#3: May 25 '07

re: Javascript onsubmit() doesn't fire WTF?


Quote:

Originally Posted by iam_clint

<form onbeforesubmit="alert('test');">

Does onbeforesubmit exist? Or is it IE only?

I think the onsubmit is fine too.
Expand|Select|Wrap|Line Numbers
  1. <form ... onsubmit="return test()">
and test() would contain alert, etc.
Reply


Similar JavaScript / Ajax / DHTML bytes