[jQuery] Submitting form via AJAX
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=781034415-12072006><FONT face=Arial color=#0000ff size=2>I have
a secondary question on this code. How would this AJAX function be "called" (in
this particular case)? Is it jus on form submit?</FONT></SPAN></DIV>
<P><FONT size=2><!----------------//------<BR>andy matthews<BR>web
developer<BR>certified advanced coldfusion programmer<BR>ICGLink,
Inc.<BR>andy@icglink.com<BR>615.370.1530
x737<BR>--------------//---------></FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com]<B>On Behalf Of </B>Albert
Garcia<BR><B>Sent:</B> Wednesday, July 12, 2006 10:36 AM<BR><B>To:</B> 'jQuery
Discussion.'<BR><B>Subject:</B> [jQuery] Submitting form via
AJAX<BR><BR></FONT></DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial size=2>Hi
guys,</FONT></SPAN></DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial size=2>I'm trying to
implement some AJAX in a form, using 1.0a version of Jquery.
</FONT></SPAN></DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial size=2>I have a couple of
questions: </FONT></SPAN></DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=188252715-12072006><FONT face=Arial size=2>- In principle,
I've read in the docs at <A
href="http://proj.jquery.com">http://proj.jquery.com</A> that the form plugin
is included in this version, but formdata() or serialize() function
doesn't work.</FONT></SPAN></DIV>
<DIV><SPAN class=188252715-12072006><PRE class=wiki> $.param( $("#form").formdata())</PRE><PRE class=wiki><FONT face=Arial size=2>- Regarding to new way of calling AJAX functions ( $.ajax instead of $.post & $.get ):</FONT></PRE><PRE class=wiki><FONT face=Arial size=2>I'm trying to make this call</FONT></PRE><PRE class=wiki> $.ajax({<BR> url: "/ajax/ajax_process.phtml",<BR> type: "POST",<BR> data: $.param( $("#form").formdata() ),</PRE><PRE class=wiki> success: function(xml) {<BR> alert ( $("response", xml).text() );<BR> },<BR> error: function() {<BR> alert ("KO");<BR> }<BR> });</PRE><PRE class=wiki><FONT face=Arial size=2>But I cannot access the xml contents. What i'm doing wrong. Have been any changes in the use of this functions? How would be the correct way of serialize a form values, <BR>and later read the xml after processing it? Any online examples using 1.0a online version? </FONT></PRE><PRE class=wiki><FONT face=Arial size=2>Thanks a lot!</FONT></PRE><PRE class=wiki><DIV align=left><FONT face=Arial size=2>Albert Garcia</FONT></DIV><DIV align=left><FONT face=Arial size=2>OboLog ยป Tus pensamientos en red</FONT></DIV><DIV align=left><FONT face=Arial size=2><A href="http://www.obolog.com/">www.obolog.com</A></FONT></DIV><DIV align=left><FONT face=Arial size=2>______________________________________________</FONT></DIV><DIV align=left><FONT face=Arial size=2>Mi blog personal en <A href="http://obokaman.obolog.com/">http://obokaman.obolog.com</A></FONT></DIV></SPAN></PRE></DIV></BLOCKQUOTE>
<STYLE>A.special_link {
COLOR: #4e81c4; TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline
}
A.special_link:hover {
COLOR: #999999
}
A.brand {
FONT-SIZE: 7pt; COLOR: #777777; TEXT-DECORATION: none
}
.normal_txt {
FONT-SIZE: 8pt; COLOR: #4e81c4; FONT-FAMILY: Verdana,Arial,fixed
}
.small_txt {
FONT-SIZE: 7pt; WIDTH: 650px; COLOR: #777; FONT-FAMILY: Verdana,Arial,fixed; TEXT-ALIGN: justify
}
.logotext {
FONT-SIZE: 10pt; COLOR: #ffffff; TEXT-DECORATION: none
}
.main_table {
BORDER-RIGHT: #355d91 1px solid; BORDER-TOP: #adc2dd 1px solid; BORDER-LEFT: #adc2dd 1px solid; BORDER-BOTTOM: #355d91 1px solid; FONT-FAMILY: Verdana,Arial,fixed
}
</STYLE>
</BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/