Home › Forums › Quform WordPress › Checkbox with input field
- This topic has 8 replies, 2 voices, and was last updated 11 years, 5 months ago by
Carboxylase.
- AuthorPosts
- January 5, 2014 at 2:15 pm #8063
Carboxylase
ParticipantHi together
Before I start to pepper you with questions I would like to thank you for that great plugin.
At the moment I try to create a donation form for a charity organization. Therefore I took the checkbox element (radio buttons) and predefined different donation amounts (e.g. $50, $100) as a third option I would like to create an input field where the donators should be able to enter their desired amount.
Is it possible to creat such a field without a big knowledge in programming respectivly by means of a short explanation/guideline?
If not, I tought to insert a simple textbox and connect the same with a logical rule to the checkbox elements third option “other amount”. The problem then would be to pass on the entered value to the checkbox element so that the value would be stored under the same attribute (e.g. ‘Donation amount’) as the predefined options ($50, $100).
Thank you for ideas/approaches to solve the problem!
Janosh
PS I wondered a little that no one else had a similar question in the forum. Maybe I should start
improving my programming knowledge 😉January 6, 2014 at 2:22 pm #8100Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 8, 2014 at 8:21 pm #8134Carboxylase
ParticipantHi Ally
Thank you for the quick answer.
Unfortunately your suggested second step doesn’t work. The values from option three aren’t stored in the same database column as the values of option 1 and 2 ($50 and $100).
How difficult would it be to code that? Maybe you could give me a few instructions how to to it. I think that some other form users could also be interested…
Regards, JanoshJanuary 10, 2014 at 4:27 pm #8189Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 18, 2014 at 2:46 pm #8360Carboxylase
ParticipantHello Ally
I followed your instructions and it works great! Thank you so much.
There is one more little thing I would like to change: Would you be able to add an other codeline that delets the “other” field after its value has been passed on to the radio button element so that it isn’t going to show up in the database?
If you don’t have time or the modification would cause a lot of work, leave it.
I’m happy with your solution. Thank you again!
Best regards, JanoshJanuary 18, 2014 at 4:29 pm #8364Carboxylase
ParticipantHi
Sorry, in the meantime I figured out how “delet” the field:
You just have to select “Don’t save value in database.” in the field options.
Thank you for the support, my problem is solved.
Regards, JanoshMarch 26, 2014 at 8:33 pm #9339Carboxylase
ParticipantHi, sorry for reopening that topic,
but I remarked an issue with the solution above:
The code also passes on empty values, what shouldn’t happen because it means that one of the predefined donation options has been overwritten.
Tried to modify the code so that it only passes on the “other” fields value if it isn’t empty, without success. Had problems with isset(…). Could you help me once more?
Thanks.March 31, 2014 at 10:40 am #9369Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 31, 2014 at 2:14 pm #9387Carboxylase
ParticipantThank you Ally
It’s working fine now!!! - AuthorPosts
- You must be logged in to reply to this topic.