I have this view code (hello.php)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script>
</head>
<body>
{{ Form::open(array('url' => 'test')) }}
{{ Form::text('email', 'example@gmail.com') }}
{{ Form::submit('hello!') }}
{{ Form::close() }}
</body>
</html>
this is my route code:
Route::get('/', function()
{
return View::make('hello');
});
Route::get('test', function()
{
return View::make('hello');
});
So the idea is that my submit button links back to my view to test if jquery mobile works with laravel.
The app works if i use:
{{ Form::open(array('url' => '/')) }}
Now it the form loops back to the same page. But does not if i do this in the form:
{{ Form::open(array('url' => 'test')) }}
Does anyone know why?
The default method for Form::open() is POST, not GET.
So, first try
Route::post('test', function() { ... });
or, alternatively
Form::open(array('url' => 'test', 'method' => 'get'))
PS: it's just amazing how unescaped html in this thread makes the entire forum a jQuery Mobile site, with ajax navigation and css stuff... too bad they're going to fix it! :)
popolla said:
The default method for Form::open() is POST, not GET.
So, first tryRoute::post('test', function() { ... });
or, alternatively
Form::open(array('url' => 'test', 'method' => 'get'))
PS: it's just amazing how unescaped html in this thread makes the entire forum a jQuery Mobile site, with ajax navigation and css stuff... too bad they're going to fix it! :)
Haha yes it is funny. I thought the site kinda looked strange :P
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community