I can't seem to get this to fire.. or indeed change the labels text. Can anyone offer any advise? The alert is there just because I was testing to see whether or not the event was actually firing.. which it doesn't seem to be. The only other piece of information is that this is a form within a fancybox iframe. I'm not even certain I have the code right to change the text, but that's the second issue really.. right now I can't get the event to fire.
Code is
<asp:DropDownList ID="ddlPUom" runat="server" CssClass="form-control input-sm"></asp:DropDownList>
<asp:Label ID="lblpuom" ccclass="col-xs-2 control-label" runat="server" Text=""></asp:Label>
<script type="text/javascript">
$('#ddlPUom').change(function () {
alert("did this fire?");
var lbltext = doc.getElementById("ddlPUom");
var lblPUOM = doc.getElementById("lblpuom");
lblPUOM.lbltext = lbltext.innerhtml;
});
</script>
Thanks for all the comments.. you steered me in the right directions. In the end I changed the labels to standard <label></label>
which worked with the above code and made a document.ready function to update from the dropdowns which are set from the code behind..