Forum Moderators: coopster

Message Too Old, No Replies

calling another php script as onclick event

         

bhagera

10:58 am on Jan 3, 2005 (gmt 0)

10+ Year Member



Hello everyone,
I have a form with
function input_button($element_name, $label) {
print '<input type="button" name="' . $element_name .'" value="';
print htmlentities($label) .'"/>';

}

I have to add a onclick function for this button so that it calls another php file.How do i do this?

Thanx
Bhagera

Salsa

4:18 pm on Jan 3, 2005 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld Bhagera!

Will adding onclick="this.form.submit()" to your tag help? That should cause the form to submit and take whatever action you've set for the form's action attribute. In the target script, you can allow whatever further action is needed, including various header() functions chosen accoring to the values returned by the form.

I hope this helps.

bhagera

6:34 am on Jan 4, 2005 (gmt 0)

10+ Year Member



Thanx!

Tht worked .:)