Alex McAuley wrote:
I replied to you with an example.
I wrote
Bill
You need to observe the form submit.
$('the-id-of-the-form').observe('submit',function(event) {
/// do the ajax that TJ said...
Event.stop(event); // will stop it doing its default action!
Chris Sansom wrote:
At 10:54 -0400 22/8/09, bill wrote:
Putting it all together (apparently wrongly) I have:
$('messageProcessForm').observe('submit',function(event) {
new Ajax.Updater('showMessageDiv', mail/process_message.php, {
parameters:
Chris Sansom wrote:
At 11:21 -0400 22/8/09, bill wrote:
now
$('messageProcessForm').observe('submit',function(event) {
new Ajax.Updater('showMessageDiv', mail/process_message.php, {
parameters: $('showMessageDiv').down('form').serialize(true),
onFailure:
] Re: POSTing a form via AJAX
Chris Sansom wrote:
At 11:21 -0400 22/8/09, bill wrote:
now
$('messageProcessForm').observe('submit',function(event) {
new Ajax.Updater('showMessageDiv', mail/process_message.php, {
parameters: $('showMessageDiv').down('form').serialize(true
- Original Message -
*From:* bill mailto:will...@techservsys.com
*To:* prototype-scriptaculous@googlegroups.com
mailto:prototype-scriptaculous@googlegroups.com
*Sent:* Saturday, August 22, 2009 6:42 PM
*Subject:* [Proto-Scripty] Re: POSTing a form via AJAX
T.J. Crowder wrote:
Hi,
'Tis indeed very easy. Say you have a form wrapped in a div:
div id='formwrapper'form
/form/div
You can post it like so and take the result (which is presumed to be
an HTML snippet in this case) and use that to update the container:
new
: bill
To: prototype-scriptaculous@googlegroups.com
Sent: Thursday, August 20, 2009 4:14 PM
Subject: [Proto-Scripty] Re: POSTing a form via AJAX
T.J. Crowder wrote:
Hi,
'Tis indeed very easy. Say you have a form wrapped in a div:
div id='formwrapper'form
/form/div
You
bill wrote:
T.J. Crowder wrote:
Hi,
'Tis indeed very easy. Say you have a form wrapped in a div:
div id='formwrapper'form
/form/div
You can post it like so and take the result (which is presumed to be
an HTML snippet in this case) and use that to update the container:
Hi,
'Tis indeed very easy. Say you have a form wrapped in a div:
div id='formwrapper'form
/form/div
You can post it like so and take the result (which is presumed to be
an HTML snippet in this case) and use that to update the container:
new Ajax.Updater('formwrapper',
Don't forget the convenience wrapper Form.request, which hijacks the
form's default settings and uses them to construct an Ajax request to
the same endpoint using the same protocol. So that means:
form id=myform action=myform.php method=post
...
/form
script ...
10 matches
Mail list logo