|
Posted by NurAzije on 10/17/06 06:45
For AJAX it is so easy, you have a 5 minutes tutorial on this link :
http://www.nurazije.co.nr/2006/10/5-minutes-ajax-tutorial.html
You can put the second bottun in the first form, like this:
<form action="" method="POST" name="Aform" target="_blank">
<select name="theList">
<option value="First'">First </option>
<option value="Second'">Second </option>
</select>
....other stuff...
<input type="submit" value="Form A button" name="A">
<input type="button" value="Form B button" name="B"
onclick="document.Aform.submit();">
</form>
You will see I have added onclick="document.Aform.submit();", and the
type is button, put an action path for the form, and change the form
name as I did, every element must have a unique name.
The php code must look like this:
<?php
if (isset($_POST['A'])) {
$list = $_POST['theList'];
header('Location: A_target.php?list=' . $list);
exit();
}elseif(isset($_POST['B'])) {
$list = $_POST['theList'];
header('Location: B_target.php?list=' . $list);
exit();
}
?>
Thats it, hope you got the idea...
Navigation:
[Reply to this message]
|