Hello,
The code below is trying to have the form submitted when the user clicks on the text "Click here". The onClick: submits the form (at least I think that is what the code is doing). My problem is that the callback never gets called. What am I doing wrong? (There are no errors reported by firebug.) renderContentOn: html (html form) id: #foo; with: [(html paragraph) onClick: (html scriptaculous request triggerForm: #foo); with: 'Click here'. (html anchor) " this callback is never called" callback: [self answer]; with: 'Done'] Many thanks, Frank _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
You need a button, anchors are never part of a form submission.
Lukas On 14 February 2012 16:39, squeakman <[hidden email]> wrote: > Hello, > > The code below is trying to have the form submitted when the user clicks on > the text "Click here". > > The onClick: submits the form (at least I think that is what the code is > doing). > > My problem is that the callback never gets called. What am I doing wrong? > (There are no errors reported by firebug.) > > > renderContentOn: html > > (html form) > id: #foo; > with: > [(html paragraph) > onClick: (html scriptaculous request triggerForm: #foo); > with: 'Click here'. > > (html anchor) > " this callback is never called" > callback: [self answer]; > with: 'Done'] > > > > Many thanks, > Frank > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside -- Lukas Renggli www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
OR you could attach the callback to a hidden input in the #foo form.
But, not using buttons to submit forms is bad because search engine crawlers hit links automatically (which you probably don't want when it comes to forms) and the information you're submitting is sent via GET rather than POST which has security implications. Lukas- are there other reasons to use buttons rather than links? On 12-02-14 08:17 AM, Lukas Renggli wrote: > You need a button, anchors are never part of a form submission. > > Lukas > > On 14 February 2012 16:39, squeakman<[hidden email]> wrote: >> Hello, >> >> The code below is trying to have the form submitted when the user clicks on >> the text "Click here". >> >> The onClick: submits the form (at least I think that is what the code is >> doing). >> >> My problem is that the callback never gets called. What am I doing wrong? >> (There are no errors reported by firebug.) >> >> >> renderContentOn: html >> >> (html form) >> id: #foo; >> with: >> [(html paragraph) >> onClick: (html scriptaculous request triggerForm: #foo); >> with: 'Click here'. >> >> (html anchor) >> " this callback is never called" >> callback: [self answer]; >> with: 'Done'] >> >> >> >> Many thanks, >> Frank >> >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |