Forum Moderators: open

Message Too Old, No Replies

Form Issue - pass two parameters with a combo box?

         

stevelibby

9:58 am on Jun 12, 2007 (gmt 0)

10+ Year Member



Hi All
I have a problem that i need to solve.
can i create a combo box that passes 2 parameters?

Example i have a combo box that i want to show model and make which i have done, so:

audi --this is just going to pass make
audi a2 --this is going to pass make and model

I have tried many ways even to the point of breaking down the passing info on the results page, but then that not clean coding.

What is my best way to do this?

rocknbil

7:16 pm on Jun 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried something like

<select name="vehicle" id="vehicle">
<option value="audi:a2">Audi A2</option>
</select>

Then when you process it server-side, split on the :.

Fotiman

7:24 pm on Jun 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Right, what rocknbill said. If your value is meant to represent 2 individual values, then use some delimeter that you can parse on server side.

stevelibby

9:40 pm on Jun 12, 2007 (gmt 0)

10+ Year Member



hi all
i had thought of spliting the main parameter once the form is processed but i had hoped for the querystring to show make=audi&model=a2 but this doesnt work. the url querystring does not look clean either. Is there any other way?

Fotiman

1:05 am on Jun 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No, not with a single form element. You might be able to fake it using some JavaScript to write to a hidden form field, but I wouldn't do that because it will be broken for anyone with JavaScript disabled.