0

can someone take a look at this please

http://jsfiddle.net/bloodygeese/ecscY/56/

it looks like I have got the 2 separate functions working but I need to get them to both work at the same time? So clicking on image1.image2,image3,image4 will change the drop down, but I also need to display the value of the drop down at the same time,

It seems I can only do this separately?

It would also be great if I could get the "label:"to display the 1st option as default. And i am going to have 16(maybe more) options in the drop down, is there any way the code can be simplified? rather than a function for each?

0

2 Answers 2

1

try this:

$('#one, #two, #three, #four').click(function() {
    $('#dropdown').val($(this).attr('id'));
    $('#dropdown').trigger('change')
})

http://jsfiddle.net/ecscY/57/

Sign up to request clarification or add additional context in comments.

1 Comment

even better! how would i get the Label:# to show "one" by default?
0

Call .change() after calling .val(). See below,

$('#dropdown').val($(this).attr('id')).change();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.