Solved

calling jquery from aspx dropdownlist list

Posted on 2014-09-15
1
83 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

Independent Software Vendors: 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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
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…

735 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