Gyan
230
4
General

Adding id to optgroup

Posted 3 years ago by Gyan

Hi,

I know how to create form group. Like this way

 {!! Form::select('mySelectElementName',array('OptgroupName1'=>array('OptionValue1' => 'OptionName1'))) !!}

the result is this :

<select name="mySelectElementName">
<optgroup label="OptgroupName1">
<option value="OptionValue1">OptionName1</option>
</optgroup>
</select>

I need to assign id to the optgroup like this:

<select name="mySelectElementName">
<optgroup label="OptgroupName1" id="test">
<option value="OptionValue1">OptionName1</option>
</optgroup>
</select>

How can I achieve that? Please suggest!

Please sign in or create an account to participate in this conversation.