Solved

calling jquery from aspx dropdownlist list

Posted on 2014-09-15
1
82 Views
Last Modified: 2015-01-27
I want to call a jquery function from aspx dropdown list. When ever the selected value is change it should displayan alert.
How can I do this please help.
0
Comment
Question by:Angela4eva
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40324416
jQuery(function($) {
//    $("#<%= DropdownList1.ClientID  %>").on("change", "select", function() {
    $("#<%= DropdownList1.ClientID  %>").on("change", function() {
          var value = $(this).val();
          var text = $("option:selected", this).text();
          alert("you choose : " + value + "\ntext is : "+text);  
    });
})

Open in new window

0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 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