jestep
unread,Jun 8, 2009, 10:56:40 AM6/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ModalBox
I am generating an html form within a modalbox. I am having trouble
getting the form to submit via an ajax function. So far, it only
submits as a normal form.
Here's what my modalbox is loaded with:
var note_form = new Element('div', {className: 'form', style:
'display:none'}).update(
new Element('form', {id: 'note_form', method: 'post'}).update(
new Element('div', {id: 'form_result', className:
'form_row'}).update(
new Element('textarea', {name: 'note', className: 'note'})
).insert(
new Element('div', {className: 'form_row form_submit',
style: 'text-align:center;'}).update(
new Element('center').insert(
new Element('input', {type: 'submit', value: 'Add
note', className: 'submit'})
)
)
)
)
);
I need the form to do this:
<form onsubmit="new Ajax.Updater('form_result', '/some/url',
{asynchronous:true, evalScripts:false, parameters:Form.serialize
(this)}); return false;" method="post" />
Here's what I'm trying to use to do that:
function noteSumbit()
{
new Ajax.Updater('form_result', '/some/page', {asynchronous:true,
evalScripts:false, parameters:Form.serialize(this)});
return false;
}
Event.observe('note_form', 'submit', noteSumbit);
Right now, it posts just like a normal form, and not through an ajax
request. Any help would be appreciated.