<div><br>Well I'll guessing this reponse but Im deduce this form html code :)</div><div><br></div><div>the deault acction is implemented by a hidden submit input.. <input type="submit" class="submit" style="position: absolute; top: -100em;" name="7" value="Default" tabindex="-1">.. in a hidden div or a text input if your browser is explorer.</div>
<div><br></div><div>In other situation when you press enter the post have your field values and the variable 7=Default,,, 7 is an id on the fly generated. that value identify the default block in the WeakDictionary of the session.</div>
<div><br></div><div>When you do submit via jquery the "7" field is'nt setting, because, nothing happend when you are do submit via Jquery.</div><div><br></div><div>For obteing your expecting behiavior i suggest 3 way.</div>
<div><br></div><div>1. Extend WAFormTag for obteing or assing the id for the default action control, and then do submit</div><div>2. Or Implement you own hidden button.</div><div>3. Obteing the id and value to defaultAction continuation and set this variable en your post..</div>
<div><br></div><div>That Solution don't be beatyfull but must work..</div><div><br></div><div>Best.</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Wed, Mar 16, 2011 at 7:27 PM, Esteban Lorenzano <span dir="ltr"><<a href="mailto:estebanlm@gmail.com" target="_blank">estebanlm@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I'm trying to add a "confirmation dialog" using jQuery in a form, and calling submit from a jquery statement is not working properly (or at least, is not working as I was hoping to work). If I submit the form using javascript, I was expecting #defaultAction: to be called, but no :(<br>
<br>
Does anybody knows how can I do this properly?<br>
<br>
In the example, I render a dialog (with a form), then a form, and the "accept" button opens the dialog. The accept button in the dialog triggers my confirmation dialog and on complete submits the original form.<br>
<br>
This is the code:<br>
<br>
renderDialogCollectExtraInfoOn: html<br>
| dialogId formId dialogFormId |<br>
<br>
dialogId := html nextId.<br>
dialogFormId := html nextId.<br>
formId := html nextId.<br>
<br>
html heading<br>
level2;<br>
with: 'Collect extra information in confirmation dialog'.<br>
<br>
html div<br>
id: dialogId;<br>
script: (html jQuery this dialog<br>
title: 'Dialog with extra info';<br>
resizable: false;<br>
modal: true;<br>
autoOpen: false;<br>
addButton: 'Accept' do: (html jQuery ajax<br>
serializeForm: (html jQuery id: dialogFormId);<br>
onComplete: ((html jQuery id: formId) call: 'submit'));<br>
addButton: 'Cancel' do: (html jQuery this dialog close));<br>
with: [<br>
html form<br>
id: dialogFormId;<br>
with: [<br>
html checkbox<br>
on: #confirm1 of: self;<br>
with: 'Confirm 1' ] ].<br>
<br>
html form<br>
id: formId;<br>
defaultAction: [ self halt. self inform: 'Ok'. "I'm expecting this to be executed" ];<br>
with: [<br>
html text: 'Some text: '.<br>
html textInput on: #text of: self.<br>
<br>
html button<br>
onClick: (html javascript<br>
add: ((html jQuery id: dialogId) dialog open);<br>
add: (JSStream on: 'return false');<br>
yourself);<br>
callback: [ self halt. "I'm not expecting this to be executed" ];<br>
with: 'Accept' ]<br>
<br>
Thanks,<br>
Esteban_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br></div>