Aug 12, 2014; 10:45
Jim Sheffer
[OT]javascript load problems using .lasso
Hello all-
I=92m working on a form submission using jquery and ajax.
Lasso 6.5x
First off, what I=92m trying to accomplish with the ajax calls:
I am a javascript neophyte - there, that=92s out of the way :-)
I=92m trying to pull multiple pieces of information into different div=92s on the page based on the form information submitted. The comments.lasso page sets the appropriate vars and builds the appropriate div=92s to be returned. The first solution seems to be a better solution (?) and although the examples below only pull one piece of information, I can easily add additional lines to the success function to load the other items(This is a snippet from a larger javascript).
I=92ve run into a problem in how the pages get processed that I don=92t understand, having to do with using .lasso as opposed to .html.
If I use the following javascript using a submitPage.lasso page, submitting the form loads the comments.lasso page, rather than bringing the info into the submitPage.lasso page. If I change the page to a submitPage.html page, leaving everything else the same, it works as expected.
Can someone explain why this happens (I thought since this is an ajax call the submitPage.lasso page wouldn=92t be sent or processed at all)?
HTML:
<form method="POST" action="inc/comment.lasso=94>
Blah Blah Blah...
JAVASCRIPT:
<script type="text/javascript">
$form.submit(function(){
$form.hide();
$.ajax({
type: "POST",
url: $form.attr("action"),
data: $form.serialize(),
beforeSend: function(){
$loading.show();
},
complete: function(){
$loading.hide();
},
success: function(data){
$billAddress.append(data);
}
})
return false;
})
</SCRIPT>
On a different page completely, this DOES work using a .lasso page using the Document.ready function and the ajaxForm method as opposed to the form.submit function and the .ajax function:
HTML:
<form id="htmlForm" action==93inc/comment.lasso" method="post=94>
Blah Blah Blah=85
JAVASCRIPT:
<script type="text/javascript">
$(document).ready(function() {
$('#htmlForm').ajaxForm({
target: '#info1',
success: function() {
$('#info1').fadeIn('slow');
}
});
});
</script>
#############################################################
Attend the Lasso Developer Conference 2014!
October 1-3, 2014 at Treefrog HQ, Newmarket, Ontario, Canada
http://www.lassosoft.com/LDC-newmarket-2014
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Aug 13, 2014; 12:21
Ke Carlton
Re: [OT]javascript load problems using .lasso
Aug 13, 2014; 15:32
Marc Vos
Re: [OT]javascript load problems using .lasso
Aug 13, 2014; 09:24
Jim Sheffer
Re: [OT]javascript load problems using .lasso