how to make field mandatory and how to increase the size of button

chandanpatra
Tera Contributor

Hi All,

How top make the select box mandatory with sysmbol(*) it should come and how to increase the size of select box. 

<div id="box" >
<label for="selectBox">Reason of Visit : Office</label>

<select id="selectBox" ng-model="data.selectedOption">
<option value="">--Select an option--</option>
<option value="a">Option A</option>
<option value="b">Option B</option>
<option value="c">Option C</option>
</select>
</div>

 

Thanks and Regards,

Chandan

1 ACCEPTED SOLUTION

SindhuKM
Tera Guru

Hi Chandan,

You can modify this code as below
<div id="box">
<label for="selectBox">
Reason of Visit: Office <span style="color: red;">*</span>
</label>
<select id="selectBox" ng-model="data.selectedOption" required style="width: 200px; height: 30px;">
<option value="">--Select an option--</option>
<option value="a">Option A</option>
<option value="b">Option B</option>
<option value="c">Option C</option>
</select>
<span style="color: red;" ng-show="form.selectBox.$error.required && form.$submitted">This field is required.</span>
</div>





 

Please hit like if this helps your question.
Thanks,
Sindhu K M

View solution in original post

1 REPLY 1

SindhuKM
Tera Guru

Hi Chandan,

You can modify this code as below
<div id="box">
<label for="selectBox">
Reason of Visit: Office <span style="color: red;">*</span>
</label>
<select id="selectBox" ng-model="data.selectedOption" required style="width: 200px; height: 30px;">
<option value="">--Select an option--</option>
<option value="a">Option A</option>
<option value="b">Option B</option>
<option value="c">Option C</option>
</select>
<span style="color: red;" ng-show="form.selectBox.$error.required && form.$submitted">This field is required.</span>
</div>





 

Please hit like if this helps your question.
Thanks,
Sindhu K M