RE: [Zope] Passing the value of a checkbox from a form to a dtml- method
From: Gitte Wange [mailto:gitte@mmmanager.org]
value of the checkbox isn't passed along to the receiving method. The checkbox code looks like this: <INPUT TYPE="checkbox" NAME="isPublic">
Perhaps you have forgotten the value it should have when checked? <INPUT TYPE="checkbox" NAME="isPublic:int" value="1"> Furthermore if a checkbox isn't checked, no value will be send at all. Maybe it would be simpler to use a select? Then you will allways get a value. <input type=select name=isPublic:int> <option value=1>Public<option> <option value=0>Hidden<option> </input> regards Max M
Hi, Max MXller Rasmussen wrote:
From: Gitte Wange [mailto:gitte@mmmanager.org]
value of the checkbox isn't passed along to the receiving method. The checkbox code looks like this: <INPUT TYPE="checkbox" NAME="isPublic">
Perhaps you have forgotten the value it should have when checked?
<INPUT TYPE="checkbox" NAME="isPublic:int" value="1">
Furthermore if a checkbox isn't checked, no value will be send at all.
one solution: <input type"hidden" name="isPublic:default" value="0"> <input type"checkbox" name="isPublic" value="1"> so when the chackbox isn't checked you get the default value. ... Holger
On Tuesday 01 May 2001 15:19, Max Møller Rasmussen wrote:
From: Gitte Wange [mailto:gitte@mmmanager.org]
value of the checkbox isn't passed along to the receiving method. The checkbox code looks like this: <INPUT TYPE="checkbox" NAME="isPublic">
Perhaps you have forgotten the value it should have when checked?
<INPUT TYPE="checkbox" NAME="isPublic:int" value="1">
Furthermore if a checkbox isn't checked, no value will be send at all.
Maybe it would be simpler to use a select? Then you will allways get a value.
<input type=select name=isPublic:int> <option value=1>Public<option> <option value=0>Hidden<option> </input>
regards Max M
Okay I have figured out that if a checkbox isn't marked, then no value will be sent. But when i tried this, the checkbox WAS checked .... I could see in the URL string that it doesn't pass the value ... i have other text fields in the form, e.g. name, and this one is passed like this: <URL>/index_html?name=fgbfgf&something=djfbjsgb ... but isPublic doesn't show up here ... not even without a value !!! Regards, -- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
A better way to look at the form data is to create a dtml document containing <dtml "REQUEST.form"> Make this document the value of the "action" attribute of the form. Then you will get a clear, easy-to-understand display of the form contents. Tom P [Gitte Wange] Okay I have figured out that if a checkbox isn't marked, then no value will be sent. But when i tried this, the checkbox WAS checked .... I could see in the URL string that it doesn't pass the value ... i have other text fields in the form, e.g. name, and this one is passed like this: <URL>/index_html?name=fgbfgf&something=djfbjsgb ... but isPublic doesn't show up here ... not even without a value !!!
participants (4)
-
Gitte Wange -
Holger Hoffmann -
Max Møller Rasmussen -
Thomas B. Passin