473,394 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how to clear values asp.net controls using java script

Hi All,

Here I need help to all of u, I am using ASP.NET 2.0 . I Have included master page in my page (
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="VB" MasterPageFile="~/ServiceReferrals/HCSOS.master" AutoEventWireup="false" CodeFile="HCSOSDetails.aspx.vb" Inherits="HomeCareSOS" %>
) then Inculding my js files like

Expand|Select|Wrap|Line Numbers
  1. <asp:Content ID="HCSoS" ContentPlaceHolderID="HCSOSDetails" runat="server">
  2. <script type="text/javascript" src="../JSUtils/GridUtils.js"></script>
  3. <script type="text/javascript" src="../JSUtils/StringUtils.js"></script>
  4. <script type="text/javascript" src="../JSUtils/PageCommon.js"></script>
  5. <script type="text/javascript" src="Includes/HCSOSDetails.js"></script>
here master page provide ContentPlaceHolder <asp:Content ID="HCSoS" ContentPlaceHolderID="HCSOSDetails" runat="server"> to add my page contents
after that I have taken asp.net2.0 text boxes and other controls within a asp pannel.
When I clear these controls value with java script then this produce object not found error
I am using following code
UI source code ----

Expand|Select|Wrap|Line Numbers
  1. <asp:Content ID="HCSoS" ContentPlaceHolderID="HCSOSDetails" runat="server">
  2. <script type="text/javascript" src="../JSUtils/GridUtils.js"></script>
  3. <script type="text/javascript" src="../JSUtils/StringUtils.js"></script>
  4. <script type="text/javascript" src="../JSUtils/PageCommon.js"></script>
  5. <script type="text/javascript" src="Includes/HCSOSDetails.js"></script>
  6.     <table class="fullWidth">
  7.         <tr>
  8.             <td colspan="6" valign="top">
  9.                 <igmisc:WebGroupBox ID="wgbRecordDetails" runat="server" Text="Record Details"
  10.                     Width="99%">
  11.                     <Template>
  12.                         <table border="0" cellpadding="1" cellspacing="1" class="fullWidth">
  13.                             <tr>
  14.                                 <td style="width: 5%; white-space: nowrap">
  15.                                     <asp:Label ID="lblClientId" runat="server" Text="Client Id:"></asp:Label></td>
  16.                                 <td style="width: 13%">
  17.                                     <asp:TextBox ID="txtClientId" runat="server" ReadOnly="True" SkinID="DisplayOnlyTextbox"
  18.                                         Width="56px"></asp:TextBox>
  19.                                 </td>
  20.                                 <td style="width: 5%; white-space: nowrap">
  21.                                     <asp:Label ID="lblClientName" runat="server" Text="Client Name:"></asp:Label></td>
  22.                                 <td style="width: 20%">
  23.                                     <asp:TextBox ID="txtClientName" runat="server" ReadOnly="True" SkinID="DisplayOnlyTextbox"></asp:TextBox>
  24.                                 </td>
  25.                                 <td style="width: 3%; white-space: nowrap">
  26.                                     <asp:Label ID="lblSPId" runat="server" Text="Service Placement Id:"></asp:Label></td>
  27.                                 <td style="width: 17%">
  28.                                     <asp:TextBox ID="txtSPId" runat="server" ReadOnly="True" SkinID="DisplayOnlyTextbox"
  29.                                         Width="56px"></asp:TextBox>
  30.                                 </td>
  31.                                 <td style="width: 5%; white-space: nowrap">
  32.                                     <asp:Label ID="lblReferralID" runat="server" Text="Referral ID:"></asp:Label></td>
  33.                                 <td style="width: 15%">
  34.                                     <asp:TextBox ID="txtReferralID" runat="server" ReadOnly="True" SkinID="DisplayOnlyTextbox"
  35.                                         Width="72px"></asp:TextBox></td>
  36.                             </tr>
  37.                             <tr style="display: none">
  38.                                 <td style="width: 5%; white-space: nowrap">
  39.                                 </td>
  40.                                 <td style="width: 13%">
  41.                                 </td>
  42.                                 <td style="width: 5%; white-space: nowrap">
  43.                                 </td>
  44.                                 <td style="width: 20%">
  45.                                 </td>
  46.                                 <td style="width: 3%; white-space: nowrap">
  47.                                 </td>
  48.                                 <td style="width: 17%">
  49.                                 </td>
  50.                                 <td style="width: 5%; white-space: nowrap">
  51.                                 </td>
  52.                                 <td style="width: 15%">
  53.                                 </td>
  54.                             </tr>
  55.                         </table>
  56.                     </Template>
  57.                 </igmisc:WebGroupBox>
  58.             </td>
  59.         </tr>
  60. </table>
  61.  
  62. function ClearScreen()
  63.             {
  64.             //alert("Anil Test")
  65.                 var d = document.all;
  66.                 var e = "";
  67.                 d.txtClientId.value= e;              
  68.  
  69.             }
  70.  
  71.  
  72.         btnCancel.Attributes.Add("onClick", "ClearScreen();return false;")
  73.  
Please provide help on this. how to resolve

Thanks

Anil Kumar Dwivedi
Jul 27 '07 #1
1 7880
pbmods
5,821 Expert 4TB
Heya, Anil.

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Jul 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
3
by: Wayne Gibson | last post by:
Hi, Was wondering if anybody could point me in the right direction. I'm looking at developing a Windows User Control using Visual Studio .NET 2005 in C#. The user control is to be used on a web...
3
by: sushi | last post by:
Hello, I am developing an asp.net website. In this I am using a web form say' Web form1.aspx' which has two button controls say 'button1' and 'button2'. When I am click 'button1' it displays a...
2
by: Pipo | last post by:
Nobody knows how to get the values provided in the client can be read in the user-control? If have made a Web Custom Control with 2 textboxes and 1 dropdownlist. The user fills in my control (the...
5
by: BLACKDOG157 | last post by:
I've made a form with a variable number of textboxes. The user fills them out, and then I need to pick up the values he has filled in. The number of textboxes vary depending on a value that the...
1
by: jason.tadeo | last post by:
I am very new to java script and I am trying to be able to have two select boxes. One that has states and one that has cities. On the change or pick of the state then the cities in my data base are...
3
by: Tenacious | last post by:
I find that I can call a function in my code behind file from Java Script on the aspx page using this syntax: Lat = <%= GetNextLatitude()%> The function has to be static. No problem so far. When...
1
by: anilkumar1980 | last post by:
Hi All, Here I need help to all of u, I am using ASP.NET 2.0 and Third party Infragistic Controls. I Have included master page in my page (<%@ Page Language="VB"...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
1
by: adarshyam | last post by:
can anybody tel me how to clear values from dynamically created text boxes?? using a clear button.. this is the code used to create dynamic text boxes.. if i press clear button then it must clear all...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.