[Seaside] Re: Form, serialize:, answer: and callback:

Dave lasmiste at gmail.com
Wed Jun 12 08:47:18 UTC 2013


Hi Johan,
 You described the concetps very well. I'm trying to better explain my
issue.

Unfortunately I have to send form data to the server twice: once without
changing page and once performing a full regular callback.
So at first my code was:

html form:[ 
	... 
	html submitButton callback: [ self answer: itsVisit ];
	text: 'ok'.
	... 
	html div with: [
			...
			html button onClick: html jQuery ajax serializeForm; with: 'Update'
			...
	]
]


That's near a solution because when I click on the 'Update' button the form
is submitted twice, Lukas pointed the issue
(http://forum.world.st/Jquery-submit-loads-page-tp3919176p3919179.html) and
provided a workaround (see "return false"). I can implement Lukas' solution
changing 
html button onClick: (html jQuery ajax serializeForm; return: false) with:
'Update'
but I'm struggling to find something clearer.


So I changed the submitButton with an anchor and onClick: etc. etc. 

html form:[ 
	... 
	html anchor onClick:(html jQuery ajax serializeForm callback: [self answer:
itsVisit ]); 
	text: 'ok'.
	... 
	html div with: [
			...
			html button onClick: html jQuery ajax serializeForm; with: 'Update'
			...
	]
]

Now the form is not submitted twice when I click on the 'Update' anchor, but
if I click the submitButton answer: does not work. 

Can you see any other solution? 
TIA 
Dave



--
View this message in context: http://forum.world.st/Form-serialize-answer-and-callback-tp4692893p4692933.html
Sent from the Seaside General mailing list archive at Nabble.com.


More information about the seaside mailing list