Forum Moderators: open

Message Too Old, No Replies

Submitting 2 options by selecting only once!

Is it possible?

         

henry0

10:41 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP environment
I have two forms that allow an user to change a BG
But A and B must be selected in order to built the page with the same color selection
As you see there is a parallel in between the two forms
Grey from A and Grey from B must be selected to obtain the desired result

How can I create a double selection that will submit both grey selections without selecting from the second set?

Another word how can I make a combo that will take care of selecting both in one shot
For example I need to pair
<option value="#cccccc">Grey #cccccc</option>
and
<option value="<img src=img/curv_g.jpg>">Grey #cccccc</option>
so the user will select only one time to triggers the combo
instead of having to go through 2 selections

Hmmm not sure it is very clear!

How can I combine A and B in one select?

A)
<select name="bg" Wrap=virtual>
<option value="#cccccc">Grey #cccccc</option>
<option value="#ffffcc">Light Lemon #ffffcc</option>
<option value="#ffffff">White #ffffff</option>
</select>

B)
Color-2 <br><? echo "<FONT COLOR=\"#800000\">VALUE RECORDED AS PER YOUR SELECTION:</FONT>";?> <b><?php print $s[curv];?></b><br>
<select name="curv" Wrap=virtual>
<option value="<img src=img/curv_g.jpg>">Grey #cccccc</option>
<option value="<img src=img/curv_y.jpg>">Light Lemon #ffffcc</option>
<option value="<img src=img/curv_w.jpg>">White #ffffff</option>
</select>

Krapulator

11:24 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not just have A and determine B on the server-side.

ScottM

11:47 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know very little php, but couldn't you give each selection a combined value with a seperator and then split [us4.php.net] the selection out?

For example:
$a="#cccccc";
$b="img src=img/curv_g.jpg";
echo "<select name=\"color\"><option value=\"$a^$b\">Grey #cccccc</option></select>";

And then split the value?

henry0

11:53 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ScottM
this is a very good idea
I am not sure yet about implementing it
but it sounds doable

<Edit>
Answer to Krapulator</edit>
Krapulator
this is a small section of an OOP/templates/CMS system
and the way all the rst is set I need to create that modif out of a form submission

thanks

henry