Support the ongoing development of Laravel.io →
Eloquent Forms
Last updated 1 year ago.
0

maybe because you are changing the window.location before the form submit is even completed.

0

I commented out the line 'window.location =wl;' and works fine! So alainbelez you were right! Thanks! I suppose it's for the reason you mentioned. But how can I redirect the window after the form is submited? (with javascript)

Last updated 9 years ago.
0

Maybe there is some way to pass a variable from my javascript function to my controller?

Last updated 9 years ago.
0

I added a hidden text box in the form:

{{ Form::text('txtRedirect', 'secret',array('id'=>'txtRedirect')); }}

I set it's value in my javascript function:

document.getElementById('txtRedirect').value='true';

I get it's value in the controller:

$redirect=Input::get('txtRedirect');

It works fine!!!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

panosss panosss Joined 18 Jan 2015

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.