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

Posted by Shelly on 10/16/06 20:58

"NurAzije" <nurazije@gmail.com> wrote in message
news:1161003925.272459.265460@m73g2000cwd.googlegroups.com...
>
> Shelly wrote:
>> I have two forms on one page. In Form A I have drop-down list (single
>> selection). When I click a submit button in form B, I would like to pick
>> up
>> the value showing in the drop down list of Form A. Can this be done?
>>
>> The reason for separating the two forms is that Form A opens a new
>> browser
>> window with selection in that form, whereas Form B keeps it in the same
>> browser window for its selections. The drop-down list value, however, is
>> used in both and I would not want to repeat that list in Form B.
>>
>> Shelly
>
> You can do it by JavaScript or by AJAX, can you provide us with the
> code, so I can explain to you eaisier ??

I don't know AJAX.

[ php code]
<?php
if (isset($_POST['A'])) {
$list = $_POST['theList'];
header('Location: A_target.php?list=' . $list);
exit();
}

<?php
if (isset($_POST['B'])) {
$list = $_POST['theList'];
header('Location: B_target.php?list=' . $list);
exit();
}
?>

[html area]
<form action="" method="POST" name="A" 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">
</form>

<form action="" method="POST" name="B" target="_self">
<input type="submit" value="Form A button" name="B">
</form>

 

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

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