I want to set the selected option of 2 select inputs from a hyperlink. This forms part of a shopping cart where I show if there is an item in stock and if there is, the user can click it. This sets the values of the corresponding options. This works fine for size when it’s whole numbers (doesn’t work for 4.5) and it doesn’t set the value of the fitting.
I’ve put the code on jsfiddle at http://jsfiddle.net/jeepstone/G6Mz5/
Any ideas?
Many thanks
There may a simpler way, but this is based on the code you already had in your fiddle:
This gets all the
optionelements and then filters them to leave only the ones which match the current text.Here’s an update fiddle.