i´m trying to validate a form in laravel 4 with Jquery Validator, the only thing i can´t perform it´s a remote validation for the email.
I tried with my browser the following
http://example.com/validacion/email/[email protected]
and i get the result (in json) that i want.
//Routes.php
Route::get('validacion/email/{email}', 'ValidatorController@getValidacionEmail');
//In my JS the rule of email is
email: {
required: true,
email: true,
remote: {
url: "/validacion/email/",
type: "get",
data: {
email: "[email protected]"
},
complete: function(data) {
if (data.responseText !== "true") {
alert(data.respuesta);
}
}
}
And when i use Firebug I get this location
http://example.com/validacion/email/?email=akatcheroff%40gmail.com
and a 301 code and after that a 500 and this error
{"error":{"type":"Symfony\Component\HttpKernel\Exception\NotFoundHttpException","message":"","file":"C:\Users\Usuario\Dropbox\Public\sitios\futbol\vendor\laravel\framework\src\Illuminate\Routing\Router.php","line":1429}}
Does anybody knows if there is a way to send my mail parameter in a way that the route recognize it?
Thanks!
url: "/validacion/email",and remove the{email}parameter on your route.