How to find the value of checkbox in a form
Kim, Soonho (IFPRI <SOONHO.KIM <at> cgiar.org>
2012-02-06 16:07:12 GMT
Dear all;
How are you?
I have a problem to find a checkbox value in a form.
Here is the page I am working on.
http://www.hyalina.com/event/building-and-updating-social-accounting-matrix-0
In the bottom of page, there is collapsed form ("Sign up for Building and Updating a Social Accounting
Matrix"). Inside, there is "Data" section. Inside "Data" section, I added a checkbox (Supply and Use
Tables/Input-Output Table). What I want to do is that if the checkbox is checked, then one textfield
(year) is shown. If unchecked, then one textfield (year) is removed.
I can get some data from $_POST. (See the above link with DSM ($_POST or See the attached). I can see the
element (data1_checkbox) of the form, but I can not find the value of the checkbox (checked or not
checked). Do you know how to find the value?
I guess that I might get the value from " $form_state['values'][data1_checkbox] " but I don't know how to
get the $form_state from $form..
Could you help me out?
Thanks so much!!
Best Regards,
Soonho

--
--
[ Drupal support list | http://lists.drupal.org/ ]