jordanhelen
asked on
drop list values
I have a web page with a drop list that have values I want to take the value the user selects and put it in a lable using vb.net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also use jquery something like so to get the value:
var selected = $("#dropdownidhere option:selected").text();
and to set the label:
$('#<%= labelidhere.ClientID %>').text(selected);
something like so:
var selected = $("#dropdownidhere option:selected").text();
and to set the label:
$('#<%= labelidhere.ClientID %>').text(selected);
something like so:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var selected = $("#dropdownidhere option:selected").text();
if(selected != "")
{
$('#<%= labelidhere.ClientID %>').text(selected);
}
});
</script>
Raj