表:选择()Laravel形式:选择()多选选项不工作,如果数组值是数字
我想选择在选择多个选项,但其唯一的工作,如果数组索引键是字符串,如果数组索引键是数字它不工作...
任何帮助,请..
工作实例:
Form::select($field_data['name'],
array('L' => 'Large', 'M' => 'Medium', 'S' => 'Small'), //Options list
array('S', 'M'), //Selected values
array('multiple')); //Multiple True
//Result: Form print and Large and Small selected
不能与数字数组键
Form::select($field_data['name'],
array('5' => 'Large', '2' => 'Medium', '10' => 'Small'), //Options list
array('10', '2'), //Selected values
array('multiple')); //Multiple True
// Just Form>select>options print, but no option selected
我想选择多个选项,选项键数字ID工作..
谢谢...其实我是这样做动态的,所以我总是接受字符串值,现在我会改变我的代码,以使其更加灵活:) –
@AsadRaza,欢迎。是的,如果可能的话,这是很好的做法。 :) –