Cannot return dropdown selection to value-when-empty after another selection made.

  • bdoodle
    Asked on November 15, 2016 at 3:57 PM

    I have two related fields on most of my forms: Spin nbr (a text box) and Spin nbr color (a dropdown box with 5 colors and N/A as value-when-empty) 

    When one is specified, so should the other be, but they can also both be empty. I use conditional field requirements to ensure this. i.e. I have conditional logic that says if the spin nbr field is filled, require the spin nbr color and vice versa.

    In the form I'm working on now that is published via iframe embed, I have a problem even though other forms of mine that use a simple embedded script work fine.  (e.g. http://www.madsails.com/Order_Buccaneer_sails.html)

    THe problem:

    The problem is that if a customer changes the spin nbr color field to a color and then changes his mind, he cannot return to an empty value in spin nbr color even if I specify N/A as a value-when-empty.  Then this forced color selection causes the spin nbr field to be required even if the customer does not want a spin nbr.  (To repeat, in my forms not using iframe, the customer can return to N/A in spin nbr color.)

    So, I added N/A as an option to the dropdown, but it its selection is perceived as filling the field. WHen a customer enters a spin nbr, they should select a color in spin nbr color, not N/A, but N/A fulfills the field requirement. 

    Is there any way to do what I want in an iframe embedded form without creating a hidden error field and showing it when spin nbr is filled and spin nbr color is N/A or empty?

  • David JotForm Support Manager
    Replied on November 15, 2016 at 4:57 PM

    Not really sure what the problem is, I just tested the form, and upon leaving the empty value, the required validation goes away:

    Cannot return dropdown selection to value when empty after another selection made Screenshot 20

    Let us know if you need more help.

  • bdoodle
    Replied on November 15, 2016 at 7:44 PM
    If you enter a sail nbr, it doesn't require that a color be entered in the sail nbr color dropdown. It accepts N/A there, but it shouldn't.
    ...
  • jonathan
    Replied on November 15, 2016 at 9:35 PM

    The 2nd rule for the Sail Nbr Color is a conflict of the 1st rule in the conditional statement. I suggest you remove it and test again.

    Cannot return dropdown selection to value when empty after another selection made Screenshot 20

     

    Let us know if this still did not fixed it.

    Thanks.

  • bdoodle
    Replied on November 16, 2016 at 1:38 AM

    Removing the 2nd rule does not solve my problem. As I said before, if you enter a sail nbr, it doesn't require that a color be entered in the sail nbr color dropdown. It accepts N/A there, but it shouldn't.

    Removing the 2nd rule also causes Spin nbr to be required when Spin nbr color is N/A.  That is wrong, so I'm keeping the 2nd rule.

  • Chriistian Jotform Support
    Replied on November 16, 2016 at 3:31 AM

    I am currently investigating your form conditions. I will update you on this thread once I have a possible workaround for this issue. Thank you.

  • Chriistian Jotform Support
    Replied on November 16, 2016 at 4:12 AM

    It appears that the reason why the N/A "Value-when-empty" option disappears from the dropdown when a user selects a color is due to a custom CSS that was added to the form. This CSS prevents the N/A or empty option from being displayed again in your dropdown field, hence the original problem occurred.

    To resolve this, simply open your form designer, then find and remove the following CSS on your form:

    select > option[value=""] { display: none; }

    Once the css is removed, you will be able to select the N/A "Value-when-empty" option, so you will not need to add the N/A as an option in your dropdown field. You will be able to use the previous conditions which were working on your other forms.

    If you need further assistance, please let us know.
    Regards.

     

  • bdoodle
    Replied on November 16, 2016 at 8:09 AM

    Thank you!  I forgot that that CSS code was there.  I do still have a problem though because that code was added because I don't want my 42 other dropdowns on the form to allow a blank selection.  Is there any way to override that (& allow blank) for the spin nbr color dropdown alone?

    Thanks again.  Your team is great!

  • bdoodle
    Replied on November 18, 2016 at 2:57 AM

    I still have an open question above related to this thread.  Are you looking at this?  Thanks.

  • emily
    Replied on November 18, 2016 at 3:48 AM

    If I understood your question correctly, you want to add blank option to spin nbr color dropdown.

    To achieve this, please go to properties of spin nbr color and add &nbsp: as an option as you can see in the screenshot below..

    Cannot return dropdown selection to value when empty after another selection made Screenshot 30

    Cannot return dropdown selection to value when empty after another selection made Screenshot 41

    I hope this solves your problem. If I did misunderstand your question or you have further questions, please let us know.

    Thanks.

  • bdoodle
    Replied on November 18, 2016 at 9:12 AM

    That seems to work perfectly!  Thanks a million!