Results 1 to 4 of 4
May 26, 2007, 07: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, 10:32 #2
- Join Date
- Jul 2005
- West Springfield, Massachusetts
- 111 Post(s)
- 1 Thread(s)
Maybe return true instead of return false?10 Rules for Driving Traffic Using Forums | Ultimate SEO Checklist
External links are nofollow
How to be a Great Online Community Member
Member of the Month for December 2013
Free SitePoint book - Thinking Web: Voices Of The Community
The 2013 SitePoint Awards - Nominations closed - Voting to begin soon
Introducing the new Code Review Forum
May 26, 2007, 19: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, 04:23 #4