Forum Moderators: open

Message Too Old, No Replies

mandatory selections in <option>

mandatory selections in <option>

         

shaan1980

10:02 pm on Sep 23, 2004 (gmt 0)

10+ Year Member



Hi guys

<optgrp labels=hi>
<option>hello</option>
</optgrp>
on submit
how do i get it send 'Hi' as well as a mandoatory option.
thanks

Purple Martin

4:36 am on Sep 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An option only sends one value, it can't send two.

However, you could add extra info to the value of an option, and then parse it server-side. e.g.

<optgrp labels="hi">
<option value="hello,hi">hello</option>
</optgrp>

then use a server-side script to split the recieved value at the comma.

coopster

1:18 pm on Sep 24, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Or if it truly is mandatory, then don't rely on the html at all and force it server-side in the script. Don't trust anything from the user agent as it can be manipulated.