Concrete5.7.5.2 - How to set selected option in select box?

I use the following code for a select box:
$form->select($name, $options, $value, $tagAttributes)

But I can't find any information where I can set one of my options to 'selected' property, for example:
<option value="" selected>My Site</option>

Anyone know? Thank you.

View Replies:
MrKDilkington replied on at Permalink Reply
Hi linuxoid,

The Form widget will add "selected="selected"" to the option element that is true.

<div class="form-group">
    <?php echo $form->label('select_example', t('Select')); ?>
    <?php echo $form->select('select_example', array('acorn' => t('acorn'), 'lemon' => t('lemon'), 'turnip' => t('turnip')), $select_example, array('style' => 'width: 125px;')); ?>

When you first use the select widget, $select_example has no value.
<select id="select_example" name="select_example" style="width: 125px;" class="form-control">
    <option value="acorn">acorn</option>
    <option value="lemon">lemon</option>
    <option value="turnip">turnip</option>

Selecting "turnip" from the select, then saving. The value of $select_example is "turnip".
<select id="select_example" name="select_example" style="width: 125px;" ccm-passed-value="turnip" class="form-control">
    <option value="acorn">acorn</option>
    <option value="lemon">lemon</option>
    <option value="turnip" selected="selected">turnip</option>
linuxoid replied on at Permalink Reply
Thank you for your reply.

From the w3schools website:

<option selected>

Differences Between HTML 4.01 and HTML5

Differences Between HTML and XHTML
In XHTML, attribute minimization is forbidden, and the selected attribute must be defined as <option selected="selected">.

Which is the correct way in C5.7?