Combo box with no default values
Last Post 08-22-2013 05:36 AM by Ryan Bakerink. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
TonyUser is Offline
going with the flow
going with the flow
Posts:45
Avatar

--
08-11-2013 07:00 PM
    Hi,
    I'm evaluating DF for a project and am having trouble with the default behavior of the combo box control.  I've added my 2 options and set No Default and still when I display the form the first option is chosen.  And if I make it required then it won;t let me submit with the first item chosen.

    What am I missing?

    Thanks,
    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-12-2013 07:43 AM
    Hello Tony,

    What Dynamic Form version are you using?

    Dynamic Forms is attempting to detect a selection on your Combo Box. If no selection/changed selection is detected then the Required Validation will fire.

    If you have only Yes & No as the options available, with No as the default selection, why do you need to add a Required Validation? The user can't select any other option other than Yes or No.

    I remember running into this issue on Dynamic Forms 4.0.x, I don't believe Dynamic Forms 4.1.4 has this issue any longer. Let me know.

    Thanks,

    Ryan
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-12-2013 09:26 AM
    Hi Ryan,
    I'm using the DF trial version 4.10.4.23731 running on DNN 7.1.0.
    I just tried another test form and it defaults to No and only passes validation if I select Yes.  If I reselect No then the validation fails.  The reason to have no choice show is to force the user to make a selection and not blindly click through the field.

    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-21-2013 05:30 AM
    Hello Tony,

    I would then recommend adding an Initial Value to your field. Let's say below is your combo box's selections:

    1.) Text = -- Select One -- Value = -1
    2.) Text = Yes Value = Yes
    3.) No = No Value = No

    #1 should be defaulted.

    I would then create a SQL Validation to prevent the first selection from being submitted. The SQL Validation will act as a Required Validation as well as preventing the initial selection from being submitted.

    The SQL Validation could look like this:
    ---------------------------------------------------------------------------------------------------

    IF '$(CombBox_ShortFieldName)' = '-1'
    BEGIN
    Select 'False' As IsValid
    END
    ELSE
    BEGIN
    Select 'True' As IsValid
    END

    ---------------------------------------------------------------------------------------------------

    Please review our Dynamic Forms User Guide to learn more about the SQL Validation feature:
    http://www.datasprings.com/userguid...rGuide.pdf

    Pages 124 & 125


    -Ryan
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-21-2013 08:43 AM
    Ryan,
    By adding the extra input choice and setting the "No default value" option for the field I managed to get the desired behavior.

    Thanks,
    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-22-2013 05:36 AM
    Great to hear.

    Let us know if you ever have any questions.

    Thanks,

    Ryan


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi