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
- 191 Post(s)
- 2 Thread(s)
Maybe return true instead of return false?► STOP using mysql - migrating to procedural mysqli !!
► How to be a Great Online Community Member
► Member of the Month for July 2014 - Patche
► Free SitePoint book - Thinking Web: Voices Of The Community
► On Our Radar This Week: ---
Big Change Coming Late August What you need to do to prepare for our migration 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