You are here: Re: Two forms « PHP Programming Language « IT news, forums, messages
Re: Two forms

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация