ApexCo
asked on
Firing jQuery on key press action
I'm trying to get this to fire using "onkeyup", here is my setup. My field is not getting set, not sure where my mistake is.
function setDirty(changeVal) {
$('<%=dirtyField.ClientID %>').val(changeVal);
}
<asp:HiddenField ID="dirtyField" runat="Server" />
//set attributes for dirty detection in data changes
txtReason.Attributes.Add("onkeyup", "setDirty(true);");
txtAWB.Attributes.Add("onkeyup", "setDirty(true);");
txtERP.Attributes.Add("onkeyup", "setDirty(true);");
ddlPriority.Attributes.Add("onclick", "setDirty(true);");
ddlCarrier.Attributes.Add("onclick", "setDirty(true);");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well done @usmansirajs !
function setDirty(changeVal) {
$('#<%= dirtyField.ClientID %>').val(changeVal);
}
ASKER
Here is final solution.
$(function setDirty(changeVal) {
$('#<%= dirtyField.ClientID %>').val(changeVal);
});
thanks for the points!