How would I make a call to a jquery function so that when a user submits a form, a image slowly fades in. I am new to jquery, and all I can find is on button clicks. would there be a way to call on the function, from php preferebly?
For any action to occur, there must be an event that triggers the action. You have already named the onclick event, but there are other events like onBlur, onChange, onLoad, onSubmit etc. that can be used as a trigger. These events can only be client side events.
I was looking at these events, but I didn't see any that apply to my scenario. here is what i was thinking....
user submits form
php picks it up, validates, and if the task is done successfully (i.e. updating fields in a db, sending an e-mail), calls on jquery to fade in the success image.
Yes, that can be done.
// if form submitted execute code to process the data
// end if
thought you had to do it in the head. tried including <script> code b/w php tags, but it doesn't seem to work. i thought you would be able to call the method, by doing something like this: echo ("<script>initImage();</script>");
Put your success page url into the PHP script.
Then use jQuery on the success page.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
isn't there just a way for the image to slowly fade in without having to re-direct?