oscarotero / form-manager

PHP library to create and validate html forms
MIT License
153 stars 42 forks source link

select option selected #72

Closed tlcko closed 7 years ago

tlcko commented 7 years ago

hello please is there a way to set a select option selected?

oscarotero commented 7 years ago

Yes, use val() to assign a value to the select:

$select = F::select([1 => 'One', 2 => 'Two']);
$select->val(2);
tlcko commented 7 years ago

thank you!