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,
- Create a DropDown-List (already did by you)
- Create a Data-Collection (ithink you have already one)
- Create an [onChange-Event-handler] on your DropDown
export function myDropDownNameHere_change(event) {PlaceToInputMyNewCode}
- iput this code into it…
console.log($w('#myDropDownNameHere').selectedIndex)
- Then it should look like this…
export function #myDropDownNameHere_change(event) {
console.log($w('#myDropDownNameHere').selectedIndex)
}
- Press F-12 in your google-Browser an go to CONSOLE.
- Look at the result.
- Now EXPAND your code…
exportfunction#myDropDownNameHere_change(event) { console.log($w('#myDropDownNameHere').selectedIndex)
console.log($w('#myDropDownNameHere').value) }
- 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?