Change DIV on select

I need to change an input in a cfform from A to B when a selection is made from a select above the inputs. Input A has an autosuggest list that works for Authors and this is the default. I have to add a list for Owners that is input B. So when someone goes to the site and selects Owners from the dropdown select box the div containing input B replaces input A. I can use javascript or jQuery 1.6
WAlexxeAsked:
Who is Participating?
 
Anuradha GoliConnect With a Mentor Systems Development / Support SpecialistCommented:
http://jsfiddle.net/anuradha/dNCHJ/1/

Here you go. (online demo http://jsfiddle.net/anuradha/dNCHJ/1/ )

HTML:

<select id="select">
    <option value="1">111</option>
    <option value="2">222</option>
    <option value="3">333</option>
</select>

<div id="warning" style="display:none">NO!!!</div>
<div id="message"  >Message!!!</div>
¿
jQuery Code;

$(function() {
    $('#select').change(function(){
        if ($(this).val() == "2") {
            $('#warning').show();
             $('#message').hide();
        } else {
            $('#warning').hide();
              $('#message').show();
        }
    });
});¿

Open in new window

0
 
WAlexxeAuthor Commented:
Worked like a charm!! Thanks!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.