adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

Feature: Ability to set selected field in select #3

Closed sicsol closed 11 years ago

sicsol commented 11 years ago

It would be great to be able to have the dropdown option take a preset value

adamwathan commented 11 years ago

You should be able to do that already, check out the documentation for the regular Form package which the BootForms package is built over. Any methods you call should pass through to the element underneath:

https://github.com/adamwathan/form#selects

So if you do something like this, you should get what you want:

BootForm::select('Age', 'age', [20, 25, 30])->select(30);

Lemme know if it doesn't work as expected, I haven't specifically tested that case but it was designed to work that way.

sicsol commented 11 years ago

seems to be working