What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

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.


  • Profile Image

    How to require customer to deselect option if they change radio field answer to no.

    Asked by daveprenter on April 14, 2014 at 07:31 PM

    Hi there,

    I have a radio button field in my form with the answers yes or no. If they select yes, then using conditions and hidden fields another radio button field appears with 3 product choices. If they choose any of these the price of that product gets added into the total.  My problem is that if the customer  selects one of these 3 products, but changes their mind and goes back and selects "No" on the original radio field, the price of the selected item still remains in the total.  However,  the product radio field is now hidden again which is obviously not a good outcome since the customer is probably not aware that he has not deselected that item.

    So if the customer still has selected items and then selects "no", how to require them to deselect those items BEFORE selecting "No". 

     

    I am referring to the "transfers" field on my form.

    Page URL:
    http://form.jotform.co/form/40992660099869

    deselect radio button field problem hidden product
  • Profile Image
    JotForm Support

    Answered by EltonCris on April 14, 2014 at 09:54 PM

    Hi,

    Sorry but I found no way to do this in the form builder. However, this is possible when you take your form source code and add script that would clear the fields once the user selects "no" on the radio button field.

    If you want to go on this route, let us know here and we'd be happy to provide you the custom script in order to achieve this function.

    Thanks!

  • Profile Image

    Answered by daveprenter on April 15, 2014 at 03:00 AM
    Hi EltonChris,
    Thank you for your kind reply, yes let's go down that route. So I have simplified the form a bit so that there is only the one radio button (#input_183_0, #input_183_1, ) . If this is selected as "No" then all the fields re transfers to be cleared (Basically everything between the Form Collapse "Begin transfers" and Form Collapse "End transfers" including of course the values of any transfers they have selected that otherwise would be added on to the totals.
    Let me know if that is not clear,
    Kind Regards,
    Dave Prenter
    --------------------------------------------
    ...
  • Profile Image
    JotForm Support

    Answered by ashwin_d on April 15, 2014 at 04:16 AM

    Hello Dave,

    Thank you for your confirmation.

    Unfortunately my colleague is not available online currently but your message has reached him. I will also take a look at your form and try to come up with the custom code to achieve your requirement. Anyway, one of us will get back to you soon.

    Thank you!

  • Profile Image

    Answered by daveprenter on April 15, 2014 at 06:40 AM
    Ok, thank you very much . I appreciate everything yoiu guys do.
    dave
    --------------------------------------------
    ...
  • Profile Image

    Answered by daveprenter on April 17, 2014 at 05:30 AM
    Hi there guys,
    Happy Easter to you all.
    Just wondering if there is any progress on this?
    Kind Regards,
    Dave
    --------------------------------------------
    ...
  • Profile Image
    JotForm Support

    Answered by EltonCris on April 17, 2014 at 06:58 AM

    @daveprenter

    Happy Easter to you too! :)

    I am truly sorry for the delay. I will provide you the script later today, probably in the next 2 hours. Please stay tuned for the updates!

    Regards!

  • Profile Image
    JotForm Support

    Answered by EltonCris on April 17, 2014 at 11:58 AM

    Here's the script. http://pastebin.com/raw.php?i=sWJQq3dT

    Just take your form source code and place this script under it (after the ending tag </form>).

    Unfortunately, I couldn't get the calculations to auto-update once these fields are cleared. I have no idea on how to place the calculation callback function on the script. However, when the user inputs again on any of the calculation fields, the changes should reflect on the calculation fields excluding the cleared field values.

    Let me know if you need anything else. Regards!

  • Profile Image

    Answered by daveprenter on April 17, 2014 at 07:40 PM
    Hi EltonChris,
    Thanks very much for that. I appreciate you spending the time. It is a pity that the calculations won't auto update as that is what I really wanted. I have tried something that seems to work . I duplicated the package totals field, modified it to not include any of the transfers. Then added conditions alongs the lines "If transfers equals no, then show "no transfer version of totals." If transfers field equals yes show original totals (which includes the transfer values).
    Seems to be working , need to repeat it for all the other totals, then check it for bugs. If you have any other ideas that might work better please let me know.
    Kind Regards,
    Dave
    --------------------------------------------
    ...
  • Profile Image

    Answered by Cesar on April 17, 2014 at 08:43 PM

    Thank for the input Dave, it is great to see you have found a very creative workaround for your issue. Unfortunately my colleague is not here at this time. Nevertheless, I would suggest to perform the replication of the condition to the other totals. Do let us know if you hit any snags during the bug testing. So that we may assist you further. Thank you.