I'm trying to do an inline validation using jquery's validate plugin
but Lift is placing this 'novalidate' attribute and the form is not
being validate.
So, I was wondering if there is any way to remove this 'novalidate' thing.
Cheers,
ggarcia
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
This is the original HTML file.
<lift:Login.login form="post" id="login-form" novalidate="novalidate">
<fieldset>
<ul>
<li>
<label for="email">E-mail</label>
<entry:email/>
</li>
<li>
<label for="password">Senha</label>
<entry:password/>
</li>
<li>
<entry:submit/>
</li>
</ul>
</fieldset>
</lift:Login.login>
This is how I see it when asked to open the source code
<form action="/adopt/" method="post" id="login-form">
<fieldset>
<ul>
<li>
<label for="email">E-mail</label>
<input value="" type="text"
name="F895243183647GRCW3M" id="email"></li>
<li>
<label for="password">Senha</label>
<input id="password"
name="F895243183648YPZVK5" type="password" value=""></li>
<li>
<input type="submit"
name="F895243283649JZWVB2" value=""></li>
</ul>
</fieldset>
</form>
And this is how I see using firebug
<form id="login-form" method="post" action="/adopt/" novalidate="novalidate">
<fieldset>
<ul>
<li>
<label for="email">E-mail</label>
<input id="email" type="text" name="F895243183647GRCW3M" value="">
</li>
<li>
<label for="password">Senha</label>
<input id="password" type="password" value="" name="F895243183648YPZVK5">
</li>
<li>
<input type="submit" value="" name="F895243283649JZWVB2">
</li>
</ul>
</fieldset>
</form>
And this is the javascript portion
<script language="JavaScript" type="text/javascript">
$(document).ready(function() {
$("#login-form").validate({
rules: {
email: {
required: true,
email: true
},
password: {
required: true
}
},
messages: {
email: {
required: "O campo email é obrigatorio.",
email: "O campo email deve conter um email válido."
},
password: {
required: "O campo senha é obrigatorio."
}
}
});
});
</script>
I don't know why, but it seems that the validate function is not
called when I click on the submit button.
Note that apparently there is no javascript errors.
Thanks in advance
best regards
Peter Petersson
> required: "O campo email � obrigatorio.",
> email: "O campo email deve conter um email v�lido."
> },
> password: {
> required: "O campo senha � obrigatorio."
go to http://localhost:8888/
and load your "designer friendly template"-file from your disk and
spot eventual problems and repeat the same procedure with the
processed template. Just be aware that the html5 parser will in most
(if not all) cases drop faulty nodes instead of generating a faulty
html5 page (this is outside of lifts control) so having a
"realistic" "designer friendly template" will help out.best regards
Peter Petersson
On 2011-11-25 20:17, Gilberto Garcia wrote:
> required: "O campo email � obrigatorio.",
> email: "O campo email deve conter um email v�lido."
> },
> password: {
> required: "O campo senha � obrigatorio."
I'm using html5 so I do have the following in my Boot.scala file
LiftRules.htmlProperties.default.set((r: Req) =>
new Html5Properties(r.userAgent))
And all my html files starts with the following
<!DOCTYPE HTML>
<html>
I will continue to digg to try to find out why jquery is not validating my form.
When I thrown it away and start usingt jQuery Validation Engine, then
everything seems to start working.
Cheers