[support] How to find the value of checkbox in a form

Kim, Soonho (IFPRI) SOONHO.KIM at cgiar.org
Mon Feb 6 16:07:12 UTC 2012


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



-------------- next part --------------
A non-text attachment was scrubbed...
Name: post.jpg
Type: image/jpeg
Size: 125641 bytes
Desc: post.jpg
Url : http://lists.drupal.org/pipermail/support/attachments/20120206/3d8a713c/attachment-0001.jpg 


More information about the support mailing list