...

View Full Version : onClick function running a PHP script, not opening a window



the moose
07-28-2009, 10:06 AM
I would like to have an onClick function that when the object (image that submits a form) is clicked on, it runs a PHP script as well as submitting the form. I can get it to work by opening a new window, but I don't want this to happen as it looks fairly spammy even when you use javascript to immediately close that window after the PHP script has done its bit.

Cheers

The Moose

MattF
07-28-2009, 10:40 AM
Is there any reason not to run the code from the file where the form processing takes place?

the moose
07-28-2009, 11:43 AM
Yep!! I don't have access to the form processing script! :)

Cheers

The Moose

the moose
07-28-2009, 03:29 PM
any ideas?!?

VIPStephan
07-28-2009, 03:51 PM
I would like to have an onClick function that when the object (image that submits a form) is clicked on, it runs a PHP script as well as submitting the form. I can get it to work by opening a new window, but I don't want this to happen as it looks fairly spammy even when you use javascript to immediately close that window after the PHP script has done its bit.

Cheers

The Moose

How about some AJAX kind of script that would run the function? If the script is on the same domain there shouldn’t be any problem, I suppose.

the moose
07-28-2009, 04:35 PM
How about some AJAX kind of script that would run the function? If the script is on the same domain there shouldn’t be any problem, I suppose.

Am trying to do this right now,but can't see how to do this...

Any ideas??

Cheers

The Moose



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum