1

The ability to add arbitrary HTML attributes to your form elements is pretty basic, but seems to be mostly unavailable in Laravel. It is mentioned in Laravel's documentation for Form::label but not for anything else:

I assumed this was just a shortcoming of the documentation, but when I tested this on Form::select, I found it does not work there:

{{ Form::select('ad_week', $report_list_filters['ad_week'], ['id'=>'ad_week']) }}

(I tried again using the older & more verbose syntax for associative arrays, but that didn't help either.)

1 Answer 1

2

Check out the official api or source code for method parameters when the docs aren't clear enough

select($name, $list, $selected = null, $options); select has an extra parameter.

{{ Form::select('ad_week', $report_list_filters['ad_week'], '', ['id'=>'ad_week']) }}
Sign up to request clarification or add additional context in comments.

2 Comments

Ah, +1 @J.T.Sage the source is much more friendly, added it the answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.