ASP.Net MVC 4 C# -- dropdown inFocus text ?

Posted on 2013-05-30
Last Modified: 2013-07-02
How can I get the attached additional text to display when a dropdown is selected ?

The text is NOT in a database.
Question by:finance_teacher
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 23

Accepted Solution

Roopesh Reddy earned 500 total points
ID: 39253882

You can do that using JavaScript. Check the below code -

 <select id="ddl">
    <span id="msg"></span>

    <script type="text/javascript">
        function OnChange() {
            var ddl = document.getElementById('ddl');
            switch (ddl.selectedIndex) {
                case 1:
                    document.getElementById("msg").innerHTML = "superficial or negligible damage";
                case 2:
                    document.getElementById("msg").innerHTML = "Minor damage";
                case 3:
                    document.getElementById("msg").innerHTML = "significant damage";
                case 4:
                    document.getElementById("msg").innerHTML = "Repairable damage";
                case 5:
                    document.getElementById("msg").innerHTML = "Non-Repairable damage";
                    document.getElementById("msg").innerHTML = "";

Open in new window

Hope it helps u...

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 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