Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion form.ajax snippet and onsubmit attribute
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter Brant  
View profile  
 More options Sep 11 2011, 11:46 am
From: Peter Brant <peter.br...@gmail.com>
Date: Sun, 11 Sep 2011 17:46:05 +0200
Local: Sun, Sep 11 2011 11:46 am
Subject: Re: [Lift] form.ajax snippet and onsubmit attribute
Yeah, I noticed that too (Lift not copying attributes from the <form>
element).  We ended up just using jQuery to install the necessary JS
vs. letting Lift include an appropriate snippet.  If you open a ticket
and assign it to me, I'll fix this, but...

what you're trying to do is a little trickier.  As Diego noted, the
form.ajax snippet wires up onsubmit to do an Ajax submit of the form,
but you want to perform some custom validation using the same event
handler.  I'm not sure of the cleanest way to handle this.  Any ideas?

Pete

On Fri, Sep 9, 2011 at 12:51 PM, Kajo Marton <kajo.mar...@gmail.com> wrote:
> yes, of course. I hope it helps. I found out that any attributes(class,
> onsubmit, postsubmit) are not 'copy' to final generated form element.
> my html template:
> <div class="lift:Users.signUp">
> <form class="signupForm lift:form.ajax" postsubmit="myPostFuntion();"
> onsubmit="validateForm();" action="">
> ...
> <input type="submit" id="signUpButton" value="Register" class="button" />
> </form>
> </div>

> generated Lift html code:

> <form id="F1237878923479A0ER3E" action="javascript://"
> onsubmit="liftAjax.lift_ajaxHandler(jQuery('#'+&quot;F1237878923479A0ER3E&q uot;).serialize(),
> null, null, &quot;javascript&quot;);return false;">

> ...

> <input id="signUpButton" class="button" onclick="liftAjax.lift_uriSuffix =
> 'zF12378789234784PJV2Y=_'; return true;" name="zF12378789234784PJV2Y"
> type="submit" value="Register">

> </form>

> and my backend class Users contains snippet signUp with designer friendly
> templates and

> ...

> "#signUpButton" #> ( SHtml.ajaxSubmit("Register", () => {...}) )

> thanks a lot.

> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/liftweb/-/NKQQGKxpZfsJ.
> To post to this group, send email to liftweb@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.