Hi there
How can I prevent ajax form's event submit when the user clicks a submit
button?
I need to prevent the event for show an confirm dialog before it will be
submited.
My form:
t:form t:id='form1' t:zone='zone1'
t:submit value=send/
/t:form
t:zone t:id='zone1' id='zone1'
/t:zone
Are you trying to create an ajax form submit? If so, you should be wrapping
the form with the zone. As far as the confirm dialog goes, you could either
use a confirm mixin or if you chose to use a zone style approach, on submit
return another zone for your confirm dialog.
On Wed, Dec 10, 2014 at
Thank you for your answer George.
Are you trying to create an ajax form submit? If so, you should be
wrapping the form with the zone
Yes, I'm trying to create an ajax form submit, I don't understand why I
should be wrapping the form with the zone, what is the reason? as far I
know in my example
Hi,
your structure should look like this:
.tml strcuture:-
t:zone t:id='zone1' id='zone1'
t:form t:id='form1' t:zone=^
t:submit value=send/
/t:form
/t:zone
t:zone t:id='zone2' id='zone2'
Your Content
/t:zone
The .java file structure
@InjectComponent
private Zone zone1,zone2;
@Inject
Hi akshay, thank you for your answer.
I had changed my example with your recomendation but the problem persist
and the ajax post is sent when you press the submit:
Test.tml
head
script
$(document).ready(function() {
$(#form1).submit(function(e) {
Is there a target release date for 5.4? I'd like to upgrade but prefer not to
do so with a beta release.
Thanks for everyone's work on this project. I've been using Tapestry for over
10 years now and hope to continue to do so.
Is there a way to contribute a client translator, just as we can contribute
client validator? I feel like there has to be but I've somehow missed it.
The situation I have is similar to field 4 in this example:
Take a look at this page, it will show you the life cycle of the tapestry
methods. You are returning zone2 in your onSuccess method. and probably
should use onSelected
http://jumpstart.doublenegative.com.au/jumpstart7/examples/navigation/whatiscalledandwhen
One way to do it to use an event
I'm not sure about the target release, but I can say I have multiple
applications in production using beta-22 and I must say it's been
incredibly stable. My cardaddy.com site has been running in production on
5.4 since spring, currently beta-22. Once you move on to 5.4 you'll never
look back.
On
Thank you for your answer George:
The other more recommended way if it's just a simple confirm box is to
use the confirm mixin
I'm using tapestry 5.3.7
I had change my example with your recomendations:
.tml
head
script
$(document).ready(function() {
hmm I see your using jquery and I know 3.7 uses prototype. Are you using
Tapestry-Jquery or bringing in jquery with no conflict?
You can write your own mixin to handle this, your not required to have to
use 5.4 to get this to work.
Here's an example of how Tapestry-Jquery is getting this to work
George, yes I'm using tapestry-jquery but in the links you wrote is the
solution:
$(#form1).submit(function(event) {
event.preventDefault();
event.stopImmediatePropagation(); // it prevents the submit hit
});
Thank you for your feedback and comments.
2014-12-10 23:20 GMT-06:00
Any last question:
Have you ALWAYS wrap an ajax form inside a zone like below?
t:zone t:id='zone1' id='zone1'
t:form t:id='form1' t:zone=^
t:submit value=send/
/t:form
/t:zone
In my first example the form isn't wrapped but it works fine. I wonder if
it is correct:
t:form t:id='form1'
13 matches
Mail list logo