JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How can I pass a radio button's options (rather than those option's values) to a text field further down in my form?Asked by Spiceweasels on July 16, 2016 at 03:15 PM
Hi there, and thanks in advance for your time. :-)
This is what I'm trying to achieve:
When a visitor clicks on the radio button (Input21) (options are "Standard," "Deep," and "One Time"), I want my form's "Level of Service" field at the bottom of the form to display "Standard," "Deep," or "One Time."
This is how I've tried to implement this:
Using the instructions posted here: https://www.jotform.com/answers/616994-Pass-text-value-from-Radio-field-to-Text-box-field
, I added a condition to my form (the one I call "Booking Form"). I used the old condition wizard interface to do this, rather than the new interface because I couldn't find the advanced option to "add field to equation as text by default" using the new interface.
This is what is happening now:
My form is displaying the calculation value for whichever radio button the visitor selects in the Input21 radio button field, rather than the text-based options they can see and select ("Standard," "Deep," or "One Time").
Where am I going wrong?
Using the old Condition Wizard interface, I made a new condition (as outlined above) and saved the form. But when I went opened the form again using the new interface and viewed the form's list of conditions, the new condition I'd just made using the old Condition Wizard interface was not listed.
I assume this was your form https://www.jotform.us/form/61953621271151
I checked the form and I see the mistake why it was not working.
You need to assign instead the options of the Radio button to the Calculation values. Then, create the Update/Calculate field condition rule.
See the video below for guidance on how to make it work.
Here is my test form as well https://www.jotformpro.com/form/61976733786979
Let us know if this did not work for you.
Thank you for your response. I truly appreciate it.
Unfortunately, I think, your solution doesn't work for me. Here's why:
When a visitor clicks the different radio buttons, I want my booking form to calculate a total order amount based upon the visitor's selection.
First, the visitor chooses the number of bedrooms and bathrooms in his home. Then, he chooses what level of service he'd like: "Standard," "Deep," or "One Time." "Standard" is one price, "Deep" costs more, and "One Time" is much less.
The form should use the visitor's responses to these questions to calculate a total cost and then pass that value to the Stripe payment integration.
Right now, my calculation formula uses the number of bedrooms and number of baths to come up with a base price, and that base price is multiplied by the calculation values (1, 3, and .5) of the radio buttons corresponding to "Standard," "Deep," and "One Time."
So, if I change the radio button's calculation values to text ("Standard," "Deep," and "One Time,"), the form cannot use those within the calculation.
I need to be able to pass the radio button's options (as text) to a text field within the same form, and I need to be able to use the same radio button's numerical calculation value in a calculation and pass that total to two other fields: 1) a text field in the "Order Summary" section within the same form, and 2) a Stripe payment field within the same form.
How do I achieve this?
I offer my apologies, for the question in bold, above, is more complex than the one I first asked in this thread. Originally, I tried to simplify the question, asking about only one problem at a time, but I'm afraid such simplification mislead you into giving me a solution that wasn't suitable for my needs. I'm sorry if I wasted your time, and I'm ~thrilled~ that you're there to help. I'm quickly becoming a JotForm super-fan, and I'll be upgrading a couple of levels. :-)
In order for your selections to have a price, you will have to set an amount to your selection. I believe we can assist you with this. Do you have a specific standard price that computes per bedroom, or is there a specific price in the number of bedrooms? Likewise for the bathrooms? How do you compute for the extra services, etc?
Looking forward to your response.
Thanks for the help. :-) I'll try to make this as clear as possible. Hang on! :-p :-D
Currently, I use this formula:
( ( ( Number of Bedrooms + Number of Bathrooms ) * Value corresponding to Level of Service ) * 25 ) = Cost of Service
Levels of Service and their values are:
Standard Cleaning - 1
Deep Cleaning - 3
Light Cleaning - .5
Note that I previously called the "Light Cleaning item "One Time" in my explanation above. I've changed it for clarity.
Thus in my formula, the Number of Bedrooms and Number of Bathrooms have an assumed value of 1 per bedroom or bathroom. The "25" in the formula is the rate I currently charge per hour ($25). I set this formula up this way in part so that I could easily increase the amount I'm charging without breaking the form.
Essentially, what the form does (for now) is adds up the number of hours the cleaning will take me (Number of Bedrooms + Number of Bathrooms) and then multiplies that by a factor of 1, 3, or .5 , to reflect the difficulty/complexity of the type of job (either Standard, Deep, or Light cleaning).
I haven't yet tried to set up the form to add an extra charge for extra services like cleaning inside ovens, etc. As you can see by looking at the form, that's where I'm going, but I figured I'd tackle one piece of the puzzle at a time. ;-)
I had envisioned that I would assign the extra services an assumed value (i.e. .5 The extra services would be assigned.
As you can see by looking at the form, I'm also needing to set a discount based on whether the customer chooses ongoing service or not.
Every Week - 15% discount
Every 2 Weeks - 10% discount
Every Month - 5% discount
So, that will have to figure into my formula (and presumably the calculation widget) eventually, as well.
That's about it. (Phew! :-) )
I hope you can help. I've spent a week on learning and setting this up, and I feel I'm allllmost there. But I know that the calculation is the engine of the beast, and running into a roadblock on that has left me rather disheartened. Guess I'm tired.
There are probably a dozen different ways to set this up, and intuitively I suspect that I've chosen a rather clunky one. Mea culpa. I'm a noob and all that. Sorry!
Thanks again for taking a look.
Thank you so much for the detailed information. I have a solution for your main concern on this thread. That is to pass the text value of the radio button (Input21) to the "Level of Service" field and its calculation values to the form calculation field and onto the Stripe payment field. I believe that once you've done that every other calculation will be much easier.
Here's how you can do that:
I have cloned your form and deleted all the conditions in it first.
Then, I duplicated the "radio button (Input21)". How-to-manage-multiple-fields
After that, I've deleted the calculation values on "radio button (Input21)"
Then, I have set the condition that will pass the value of the "radio button (Input21)" to its duplicate radio button.
The result, whatever option is selected from the "radio button (Input21)" , it will also be selected on its duplicate radio button field.
We will then create conditions that will pass the text value of the "radio button (Input21)" to the "Level of Service" field.
Remember that when we duplicate the "radio button (Input21)", we did not remove the calculation values on its duplicate radio field. Meaning, the duplicate radio button will still have the calculation values for the computation. We will need to hide that duplicate field so it will not show on the form.
In the clone version of your form where I have applied the changes mentioned above, I just placed the duplicate radio button on the "Cost" form calculation widget.
Here's how it works:
Here's the clone version of your form where I have applied the changes above.
I hope this helps. Please let us know if you need any further assistance with the other calculations on your form.