Connect Dropdown to related affiliate link

hey,
I am creating a website that shows Mobile specification and there is a dynamic page where there is all the information about that mobile phone and also a link to buy that smartphone online. now I want to add a dropdown from where the user will select the mobile variant like 6GB + 128GB/8GB + 256GB and corresponding to that variant I want to display my affiliate link to buy that smartphone from Flipkart in a textbox and by clicking it the user will be redirected to that page in Flipkart but I don’t have any idea about how I can achieve it.

Your help will be very valuable, Thank You in advance.

Hello Tiefes Patel,

  1. Create a DropDown-List (already did by you)
  2. Create a Data-Collection (ithink you have already one)
  3. Create an [onChange-Event-handler] on your DropDown
export function myDropDownNameHere_change(event) {PlaceToInputMyNewCode}
  1. iput this code into it…
console.log($w('#myDropDownNameHere').selectedIndex)
  1. Then it should look like this…
export function #myDropDownNameHere_change(event) {
      console.log($w('#myDropDownNameHere').selectedIndex)
    }
  1. Press F-12 in your google-Browser an go to CONSOLE.
  2. Look at the result.
  3. Now EXPAND your code…
exportfunction#myDropDownNameHere_change(event) {      console.log($w('#myDropDownNameHere').selectedIndex)
console.log($w('#myDropDownNameHere').value)    }
  1. Do some changes in your DropDown and look what happens in the CONSOLE!
    Can you follow?

I have a little problem with the Dropdown menu part. The problem is that I have written all the different variants in a single line with a comma . so when I connected the dropdown with the database it’s showing everything in a single line but I want each variant in separate lines.

any solution for that?