Home › Forums › Quform PHP › Need Selected Option (not Value) returned in email
- This topic has 3 replies, 2 voices, and was last updated 6 years, 1 month ago by bb3.
- AuthorPosts
- October 25, 2018 at 4:46 pm #27480bb3Participant
Hi,
I have something like this example in my form, which also has a calculator to output the total price according to a quantity chosen by customer.
<select name=”ball” onChange=”calculatePrice()” id=”ballType”>
<option value=”3.00″>Blue ball</option>
<option value=”2.50″>Red Ball</option>
<option value=”5.00″>Rainbow Ball</option>
<option value=”1.50″>Green Ball</option>
</select>
The email sent by the form returns values to me, but instead, I want to get the product description the customer has chosen. So, I want the selected option to arrive in the email message, instead of the value. Is this possible?Thanks to anyone who can help
October 26, 2018 at 5:21 pm #27503AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 26, 2018 at 6:19 pm #27506bb3ParticipantThanks again!
This kind of solution you suggest occurred to me, but I didn’t know how to implement it.
It’s tough going with a form like this when I only know html and css, but not javascript or php.
It was a fluke getting the calculator to work in the first place. Was afraid to mess with it, but will try this anyway.Didn’t realise only the value is sent …
Read somewhere … that if no value is present, the selected text is taken as the value? Is that true?
Appreciated!
bbOctober 27, 2018 at 12:47 am #27511bb3ParticipantI tried your javascript and it worked fine. Never saw code like it before – could be genius for all I know – it works and that’s all that matters. I’m happy 🙂
Had to do a similar workaround with the quantity values. Total price = selected product x selected quantity, but individual product price went down as quantity went up. It would have been nice to do the calculation with percentages but that was beyond my capabilities, so a much more ‘inelegant’ workaround was called for.
I’ll be keeping this one for future reference.
Many thanks
bb - AuthorPosts
- You must be logged in to reply to this topic.