You are viewing limited content. For full access, please sign in.

Question

Question

Default option selected for dropdown field

asked on June 5, 2017

Hello:

We have a "change form" that is populated with data based on a form that someone else submits.

Form A (Request form) --> Form B (Update Request form)

These forms are connected via a simple hidden field we called ID. I know real creative there.

Once a user fills out form A and submits it someone else gets the "Check me out" email. They use the link in the email to access Form B. In Form B they need to change the information to make changes to the infor that was submitted. Form A users aren't always that bright.

 

Here is where we have hit the roadblock. The form B dropdowns only populate with 1 entry each. That of course is the entry matching the hidden field ID in the DB. So we are getting the correct information passed from form to form but a drop-down of 1 option is kind of silly and doesn't allow for changes.

 

So to reiterate a drop-down in form A might look like this:

ID is Hidden

--ID-- --Fruit--

--  --  --   -- (null empty no idea how to get rid of it either)

--01-- --Apples--

--02-- --Bananas--

--03-- --Pears--

But the resultant form generated by passing the ID creates a form that looks like this on From B:

--ID-- --Fruit--

--01-- --Apples--

 

Ideally what we would get if say Bananas was selected is this:

--01-- --Apples--

--02-- --Bananas-- (selected and showing as SELECTED as is normal in HTML https://www.w3schools.com/tags/att_option_selected.asp )

--03-- --Pears--

 

Any thoughts or ideas?

 

Thanks in advance.

Richard

0 0

Replies

replied on June 7, 2017 Show version history

Richard,

It sounds like you what you should be doing is using the same kind of drop down with all of the options on Form B, then use the following process instead (this is going to require JavaScript/JQuery):

  • Create a hidden single line field for the selection from Form A
  • Set a JavaScript/JQuery on "change" event on that field
    • Locate the matching option in the drop down and set it as selected programmatically
    • After it is selected, manually trigger the "change" event for the drop down to ensure the new value is saved.
  • Populating this field using the Lookup rule (based on your ID) should trigger the change event you assign to the field
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.