Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2013-05-30
Medium Priority
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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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 asp.net 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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

610 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