Get DropeDownList Selected Value

Yasmin Saad asked on November 29, 2017 02:22

Hi guys , I have a dropdownList in [Form1] and I have some properties regarding each option in that dropdownList in [Form2]. I've returned the content of the drop down through a sql query . How can I save the selected value of the dropedown in [Form1]to display the corresponding properties in [Form2]. Thanks Yasmeen

Recent Answers


Mariia Hrytsai answered on November 29, 2017 09:59

Do you have two separate Kentico forms on the same page? Do you use portal engine to place forms on the page? Or do you have some custom ascx page or web part?

0 votesVote for this answer Mark as a Correct answer

Yasmin Saad answered on November 29, 2017 10:41

hi Mariia , I'm using portal engine and I have the two forms into two separated webparts . I want the two webparts to appear as a wizard so I used the wizard page manager webpart. Thank you

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on November 29, 2017 14:26 (last edited on November 29, 2017 14:27)

The page wizard requires you to implement your own custom code. On step 1 when they hit next, you validate then save step 1s items. On step 2 then you can look up step 1s stuff by looking where that info was saved. They don't by default carry on, so here are some options.

  1. Save the drop down value in the users session on save so you can pull it up in there next (cookies required)
  2. Create a temporary table holding the values that you can query.
  3. Not sure if you can do this but you can try to inject into the form a post value manually and try to catch it on the load step on the 2nd page.

If you are not worried about catering to cookie disabled users then just use the session, otherwise try to get the post value passed in the form.

https://docs.kentico.com/k9/custom-development/developing-web-parts/advanced-web-part-development-scenarios/connecting-web-parts-with-the-page-wizard

0 votesVote for this answer Mark as a Correct answer

Mani Sharma answered on November 29, 2017 17:43

You can connect them using javascript functions and set the value dynamically to the control.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.