?
Solved

Change DIV on select

Posted on 2012-08-24
2
Medium Priority
?
766 Views
Last Modified: 2012-08-28
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
0
Comment
Question by:WAlexxe
2 Comments
 
LVL 12

Accepted Solution

by:
Anuradha Goli earned 2000 total points
ID: 38328796
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
 

Author Closing Comment

by:WAlexxe
ID: 38339760
Worked like a charm!! Thanks!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question