Results 1 to 4 of 4
May 26, 2007, 08:48 #1
onClick event handler prevents PHP script from beeing processed? :-(
I want to show a simple animated (loading) icon when a user pressed on the submit button/submitted the form. A PHP script is then executed and processes some data until it returns a status message.
<form enctype="multipart/form-data" method="POST" action="action_upload.php">
<input name="submit" onClick="showDiv('loadingDiv'); return false;" type="image" src="button.gif">
can anyone help me out here pls?? thx!!
May 26, 2007, 11:32 #2
- Join Date
- Jul 2005
- West Springfield, Massachusetts
- 198 Post(s)
- 3 Thread(s)
Maybe return true instead of return false?Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
May 26, 2007, 20:53 #3
- Join Date
- Mar 2005
- 0 Post(s)
- 0 Thread(s)
Mittineague is correct. In many browsers returning false form the onclick handler of a submit button will stop a form from submitting.
It's better to use the form's onsubmit handler instead of the submit button's onclick handler.
May 28, 2007, 05:23 #4