AnsweredAssumed Answered

Dynamically add Options to Select

Question asked by billr@stcu.org on Nov 8, 2017
Latest reply on Nov 13, 2017 by billr@stcu.org

Overview:

We use and external data lookup and in turn populate form elements.

One of the pieces retrieved is added to a Select element on the form. All of that is working just fine.

An inspection of the HTML shows the items have been added, however, when the form is submitted a SharePoint error is thrown and the form submission fails.

If a static Option (not added by jQuery) in the Select is chosen the form submits just fine.

Details:

  1. We are using a REST call via jQuery and retrieving JSON
  2. JSON is well formed
  3. We then loop over the options and append them to the Select

Example:

<select name="ctl00$SPWebPartManager1$g_f3cb44cb_28a3_493f_8344_c409b53f4e86$ctl00$ListForm2$formFiller$FormView$ctl18$f1b815d2_ac95_4bc5_8e56_236efde79a32"
 class="nf-choice-select nf-associated-control"    id="ctl00_SPWebPartManager1_g_f3cb44cb_28a3_493f_8344_c409b53f4e86_ctl00_ListForm2_formFiller_FormView_ctl18_f1b815d2_ac95_4bc5_8e56_236efde79a32"
    formcontrolid="9850bce4-6706-4791-9fbf-837cd4b35932" data-use-attribute-as-value="data-nfChoiceValue">
 <option value="1">Other</option>
 <option value="51363800002">Card - 51363800002</option>
 <option value="20008">Book - 20008</option>
 <option value="10006">Mortgage - Long term - 10006</option>
 <option value="10006">Mortgage - Short term - 10006</option>
</select>

 

Other is added via the Nintex Form Control
All other options are added via jQuery

 

Thoughts?

Outcomes