|
Posted by Shelly on 10/16/06 22:10
"Shelly" <sheldonlg.news@asap-consult.com> wrote in message
news:RnSYg.7853$Lv3.2073@newsread1.news.pas.earthlink.net...
>
> "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>
That second one should be "Form B button" and the second <?php was a cut
and paste error.
[Back to original message]
|