We wrote a generic "form is dirty" implementation on the body unload event. WebNumericEdit control has a blank space in the defaultValue property even when the control is not touched on the browser.
This check always return true in the javascript function.
if (type == "hidden" || type == "password" || type == "text" || type == "textarea" || type == "file") { if (element.value != element.defaultValue) { return true; } }
How do we differentiate this control with other elements? Is there a way to set the defaultValue to empty string?
Here is my HTML for the control -
<igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server" HideEnterKey="true" SelectionOnFocus="CaretToEnd" DataMode="Decimal" Width="80px" Height="18px"></igtxt:WebNumericEdit>
Hi Ram,
Was the reply from me and Victor helpful? Please update the forums if you would like to discuss this issue further?
Magued
Magued, you had this code in your HTML and I was not sure what it was doing -<ClientSideEvents Initialize="WebNumericEdit1_Initialize" />
But the sample Viktor provided help me to fix the problem. I could see what was done in the initialize event. I am still working to see if it breaks on some under condition.
Thanks to both of you for your guidance.