Hi,
I'm having a problem clearing the values within a table and hoped for some input. I have a table with values that can be entered by the user. I also have a clear button, that when clicked executes javascript to set the value to "". I've added a RadAjaxManager proxy to update the table when the clear button is clicked. My problem is that the whole table disappears not just the values. Can you tell me what I am doing wrong?
And here is the RadAjaxManager proxy settings
Thanks in advance for any advice you can give me.
Chris
I'm having a problem clearing the values within a table and hoped for some input. I have a table with values that can be entered by the user. I also have a clear button, that when clicked executes javascript to set the value to "". I've added a RadAjaxManager proxy to update the table when the clear button is clicked. My problem is that the whole table disappears not just the values. Can you tell me what I am doing wrong?
<
asp:Table ID="IndexTable" runat="server" EnableViewState="false" >
</asp:Table>
<
asp:Button ID="btnClear" runat="server" Text="Clear" Width="85px"
style="text-align:center;vertical-align:middle;margin-left:10px"
OnClientClick="ClearIndexData();" />
<
telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript" >
function ClearIndexData() {
|
//repository |
repo = document.getElementById("ctl00_MainContent_hfRepoHint").innerText; |
//custom indexes |
for (i = 1; i <= 20; i++) { |
if (document.getElementById("ctl00_MainContent_radIndex" + i.toString() + "S") != null) { |
if (repo.charAt(0) == '5') |
document.getElementById("ctl00_MainContent_radIndex" + i.toString() + "S").value = ""; |
else |
document.getElementById("ctl00_MainContent_radIndex" + i.toString() + "S").value = ""; |
} |
else if (document.getElementById("ctl00_MainContent_radIndex" + i.toString() + "R") != null) { |
if (repo.charAt(0) == '5') |
document.getElementById("ctl00_MainContent_radIndex" + i.toString() + "R").value = ""; |
else |
document.getElementById("ctl00_MainContent_radIndex" + i.toString() + "R").value = ""; |
} |
} |
}
</script>
|
And here is the RadAjaxManager proxy settings
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="btnClear"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="IndexTable" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManagerProxy> |
Chris