Sir/Madam
I am going to create a a form with a reset button which can clear the fields of the form
But the function cannot work. The previous record entered in the box is still here.
Would you please tell the methodology to clear the forms on the CLIENT SIDE ?
the below is my code:
<script type="text/javascript">
...
function ClearForms(sender, args) {
document.getElementById('<%=txtRemeasureCode.ClientID%>').innerText() = "";
document.getElementById('<%=dapSubmitTo.ClientID%>').clear();
document.getElementById('<%=dapSubmitFrom.ClientID%>').clear();
}
.. .
<telerik:RadTextBox ID="txtRemeasureCode" Width="200px" runat="server" AutoPostBack="false" />
....
<telerik:RadDatePicker ID="dapSubmitFrom" runat="server" MinDate="2010-01-01" AutoPostBack="false" Width="200px">
<Calendar ID="CalendarFrom" RangeMinDate="2010-01-01" runat="server">
</Calendar>
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
<DateInput DisplayDateFormat="yyyy-M-d" DateFormat="yyyy-M-d" runat="server" ></DateInput>
</telerik:RadDatePicker>
.....
<telerik:RadDatePicker ID="dapSubmitTo" runat="server" MinDate="2010-01-01" AutoPostBack="false" Width="200px">
<Calendar ID="CalendarTo" RangeMinDate="2010-01-01" runat="server">
</Calendar>
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
<DateInput DisplayDateFormat="yyyy-M-d" DateFormat="yyyy-M-d" runat="server"></DateInput>
</telerik:RadDatePicker>
...........
..............
<telerik:RadButton ID="btnReset" runat="server" Text="Reset" OnClientClick="ClearForms;return false">
<Icon PrimaryIconUrl="~/Image/Button/reset.gif" PrimaryIconLeft="4" PrimaryIconTop="4" />
</telerik:RadButton>
This is working code :