function txtAstonchange() {
var text = document.getElementById('<%= txtassetvalue.ClientID %>').value
if (text >= 1 && text <= 5) {
__doPostBack("txtassetvalue", 0);
}
else {
alert("Enter Value Between 1 and 5");
document.getElementById('<%= txtassetvalue.ClientID %>').value = document.getElementById('<%=hidtxtAst.ClientID %>').value
return false;
}
}
I have one text box I only want to do postback when value entered between 1 and 5 .but the problem here is that suppose at first value in text box is 4 and then change value and entered 8 in the text box .till this point this is working fine because value entered is not in range 1-5 its prompts the error msg and bind the hidtxtAst.ClientID to the text box .but here there is change in value from at starting 4 then entered value 8 and then hidtxtAst.ClientID value which is previous value i.e 4 so here it consider value change from 8 to 4 and postback occurs.i don't want this postback to occure