Jump to content

Option Group Return Label


LostSole

Recommended Posts

Hi,

 

is there a way to return the option group label of a drop-down box created in HTML?

 

Eg.

<select>
<optgroup label="Swedish Cars">
<option value ="volvo">Volvo</option>
<option value ="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value ="mercedes">Mercedes</option>
<option value ="audi">Audi</option>
</optgroup>
</select>

How do i know if the car selected was a swedish car or a german car?

 

Many thanks!

Link to comment
https://forums.phpfreaks.com/topic/92611-option-group-return-label/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.