1

In Laravel, we can do forms with this:

{{Form::radio(name, value, checked, options)}}
{{Form::checkbox(name, value, checked, options)}}
{{Form::select(name, list, selected, options)}}
{{Form::text(name, value, options)}}
{{Form::textarea(name, value, options)}}

But, how can we do for custom type of input? For example:

<input type='color' name='color' class='colorpicker' />

I have tried with this, but it doesn't work:

{{Form::text('color', null, array("type"=>"color"))}}

How can I achieve that with Laravel form?

Thank you.

1 Answer 1

5

To generate an input with type color, you need to use the input method:

{{ Form::input('color', 'car_color', null, array('class' => 'input-big')) }}

This is the declaration of the input method:

public function input($type, $name, $value = null, $options = array()) { ... }
Sign up to request clarification or add additional context in comments.

Comments

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.