Re: Form with just checkboxes does not allow to switch all off?!?
[email protected] Thu, 17 Jan 2013 19:25:27 -0800
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
You have to include a hidden element. David On 2013-01-17, at 7:13 PM, Chuck Hill <[email protected]> wrote: > That is an old HTML feature. A form containing all unckecked = checkboxes submits nothing. You are not the first to have been bitten! >=20 > Chuck >=20 >=20 >=20 > On 2013-01-17, at 7:01 PM, Ond=C5=99ej =C4=8Cada wrote: >=20 >> Hello there, >>=20 >> I've got this kind of form: >>=20 >> <wo:form action =3D "$app.emptyAction"> >> Check >> <wo:checkbox checked =3D "$auctionTemplate.hiddenForOwner" onchange =3D= "this.form.submit();" /> hidden for owner=20 >> <wo:checkbox checked =3D "$auctionTemplate.hiddenForBroker" onchange = =3D "this.form.submit();" /> hidden for broker >> </wo:form> >>=20 >> where app.emptyAction is truly an empty action (no contents, returns = null), and it works excellently -- unless the last of the switches = (regardless which one) is to be switched off. >>=20 >> In that case, the form properly reloads, but auctionTemplate is _not_ = changed at all -- the application is _not_ informed about the change, = and the hiddenForXXX property stays on. >>=20 >> Just by chance, I've found that if I add a completely unused variable = 'wtf' to the component and change the form thus: >>=20 >> <wo:form action =3D "$app.emptyAction"> ### action which does = nothing at all >> Check >> <wo:checkbox checked =3D "$auctionTemplate.hiddenForOwner" onchange =3D= "this.form.submit();" /> hidden for owner=20 >> <wo:checkbox checked =3D "$auctionTemplate.hiddenForBroker" onchange = =3D "this.form.submit();" /> hidden for broker >> <wo:hidden value =3D "$wtf"/> >> </wo:form> >>=20 >> it works quite all right. >>=20 >> What the heck?!? Is that a known bug in HTML or WebObjects or...what? = Or is there some weird problem in my code somewhere? >>=20 >> Thanks and all the best, >> --- >> Ondra =C4=8Cada >> OCSoftware: [email protected] http://www.ocs.cz >> private [email protected] http://www.ocs.cz/oc >>=20 >>=20 >>=20 >> _______________________________________________ >> WebObjects-dev mailing list >> [email protected] >> http://www.omnigroup.com/mailman/listinfo/webobjects-dev >=20 > --=20 > Chuck Hill Senior Consultant / VP Development >=20 > Practical WebObjects - for developers who want to increase their = overall knowledge of WebObjects or who are trying to solve specific = problems. =20 > http://www.global-village.net/gvc/practical_webobjects >=20 > Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest = Growing Companies in B.C!=20 > Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking = of Canada=E2=80=99s Fastest-Growing Companies by PROFIT Magazine! >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > _______________________________________________ > WebObjects-dev mailing list > [email protected] > http://www.omnigroup.com/mailman/listinfo/webobjects-dev