Support the ongoing development of Laravel.io →
Forms
Last updated 2 weeks ago.
0

Can you please show me the html view/code of this form along with these code? it would be easier to debug and find the issue.

0

Custom macro:

        Form::macro("select_nh", function($id, $selected, $attrs){
            $vals = array(1, 2, 3, 4, 5);
            $arr = array();

            foreach($vals as $v){
                $arr[$v] = "$v h";
            }

            return Form::select($id, $arr, $selected, $attrs);
        });

View:

{{ Form::select_nh('n-h', 2, ["class" => "required"]) }}
Last updated 4 years ago.
0

I just found an url parameter was modifying default value...

0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

Juan Antonio Juan Antonio looper Joined 3 Jul 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.