Home › Forums › Quform WordPress › IF…ELSE Checkbox and Hidden Field
- This topic has 5 replies, 2 voices, and was last updated 10 years, 1 month ago by Ally.
- AuthorPosts
- March 14, 2014 at 10:29 am #9170CarboxylaseParticipant
Hi together
I’m not very good in PHP… so I have two questions:- How can I define the values for not checked checkbox elements/options?
- How can I assgin a value to a hidden element/field depending on a variable for example post_id?
E.g. IF post_id=500 THAN ‘formXY’ ELSEIF post_id=851 THAN ‘formYX’.
Would be really thankful if somebody could explain me how to do that.
March 14, 2014 at 11:07 am #9176AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 14, 2014 at 7:48 pm #9183CarboxylaseParticipantHi Ally
Thank you for your quick reply!- I set a custom value, but if the box isn’t ticked the value is empty. That’s what I want to change, save a specific value in the databse if the option isn’t ticked, e.g. “box not checked”.
- Thanks, solved – after a while. Wasn’t shure which expressions to replace with custom data
I don’t want to abuse your support, so tell me if my questions go too far, but would be cool if you could help me again with my first question (elment id is “iphorm_3_4”; value if not checked should be “unchecked”).
Thanks!
March 17, 2014 at 1:12 pm #9199AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 26, 2014 at 8:17 pm #9338CarboxylaseParticipantHi Ally
In the meantime I tested your suggested solution:
<input type="hidden" name="iphorm_3_4" value="unchecked" />
It doesn’t work. Created a HTML element and and added the code above. As result the value “unchecked” was always saved in the database, even if the box/option was checked.
What’s wrong? Why does that expression overwrite everything?
Thank you for your help!March 31, 2014 at 10:37 am #9368AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.