R
rum23
I have an asp:ImageButton on the page and it calls a javascript method
onClientClick attribute. The javascript method simply clears the text box
fields.
However, after clearing the text boxes, the page refreshes too and I don't
want the page refresh. How can I avoid this?
<asp:ImageButton ID="lbkClearLineItems" runat="server"
CausesValidation="True" ToolTip="Clear items"
OnClientClick="javascript:ClearLineItemData(this);"
ImageUrl="~/CIP/Images/deleteIcon.jpg" />
javascript function is as follows
function ClearLineItemData(therow)
{
var sControlName = therow.name;
sControlName = sControlName.replace("lbkClearLineItems", "");
document.getElementById(sControlName + 'txtamtfoot').value = "";
document.getElementById(sControlName + 'txtitemfoot').value = "";
}
Please help.
Thanks
onClientClick attribute. The javascript method simply clears the text box
fields.
However, after clearing the text boxes, the page refreshes too and I don't
want the page refresh. How can I avoid this?
<asp:ImageButton ID="lbkClearLineItems" runat="server"
CausesValidation="True" ToolTip="Clear items"
OnClientClick="javascript:ClearLineItemData(this);"
ImageUrl="~/CIP/Images/deleteIcon.jpg" />
javascript function is as follows
function ClearLineItemData(therow)
{
var sControlName = therow.name;
sControlName = sControlName.replace("lbkClearLineItems", "");
document.getElementById(sControlName + 'txtamtfoot').value = "";
document.getElementById(sControlName + 'txtitemfoot').value = "";
}
Please help.
Thanks