Support the ongoing development of Laravel.io →
Input Views Blade
Last updated 1 year ago.
0

Form::text('option'.[$key]['name'] that looks bad syntax, try this: Form::text( 'option[' . $key . '][name]',

Last updated 1 year ago.
0

arcollector said:

Form::text('option'.[$key]['name'] that looks bad syntax, try this: Form::text( 'option[' . $key . '][name]',

I have update my syntax. Thanks.

Actually is on Input::old('option')[$key][$session['name']] how do I get the value of this input?

It's return to Undefined index: name

Last updated 1 year ago.
0

Input::old('options')[$key][$session['name']] ????

Last updated 1 year ago.
0

arcollector said:

Input::old('options')[$key][$session['name']] ????

Sorry, syntax update.

Last updated 1 year ago.
0

well $session hasn't an index called 'name' try dd( $session ) and check its output

Last updated 1 year ago.
0

arcollector said:

well $session hasn't an index called 'name' try dd( $session ) and check its output

have 'name' on the current array. array(3) { ["'name'"]=> string(8)...

Last updated 1 year ago.
0

looking your code

@foreach( Input::old('option') as $key => $session )
    {{ Form::text('option[' . $key . '][name]',  Input::old('option')[$key][$session['name']] ) }}
@endforeach

I dont like the Input::old('option')[$key][$session['name']] why don't just write this $session['name'] ???

Last updated 1 year ago.
0

arcollector said: I dont like the Input::old('option')[$key][$session['name']] why don't just this $session['name'] ???

Actually just $session['name] but still get the ErrorException : Undefined index: name

I'm looking for the same problem at http://forumsarchive.laravel.io/viewtopic.php?pid=21058#p21058

The var_dump will return to Undefined index too.

Last updated 1 year ago.
0

mmm, try this

isset( $session['name'] ) ? $session['name'] : 'some default value'

Last updated 1 year ago.
0

arcollector said:

mmm, try this

isset( $session['name'] ) ? $session['name'] : 'some default value'

Ouch!!.. My bad. I put ["name"] to my form. That's why Undefined index. Thank you arcollector.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kampit kampit Joined 2 Mar 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.