473,654 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to clear values asp.net controls using java script

5 New Member
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" MasterPageFile= "~/ServiceReferral s/HCSOS.master" AutoEventWireup ="false" CodeFile="HCSOS Details.aspx.vb " Inherits="HomeC areSOS" %>) then Inculding my js files like
<asp:Content ID="HCSoS" ContentPlaceHol derID="HCSOSDet ails" runat="server">
<script type="text/javascript" src="../JSUtils/GridUtils.js"></script>
<script type="text/javascript" src="../JSUtils/StringUtils.js" ></script>
<script type="text/javascript" src="../JSUtils/PageCommon.js"> </script>
<script type="text/javascript" src="Includes/HCSOSDetails.js "></script>
here master page provide ContentPlaceHol der <asp:Content ID="HCSoS" ContentPlaceHol derID="HCSOSDet ails" 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 ----
<asp:Content ID="HCSoS" ContentPlaceHol derID="HCSOSDet ails" runat="server">
<script type="text/javascript" src="../JSUtils/GridUtils.js"></script>
<script type="text/javascript" src="../JSUtils/StringUtils.js" ></script>
<script type="text/javascript" src="../JSUtils/PageCommon.js"> </script>
<script type="text/javascript" src="Includes/HCSOSDetails.js "></script>
<table class="fullWidt h">
<tr>
<td colspan="6" valign="top">
<igmisc:WebGrou pBox ID="wgbRecordDe tails" runat="server" Text="Record Details"
Width="99%">
<Template>
<table border="0" cellpadding="1" cellspacing="1" class="fullWidt h">
<tr>
<td style="width: 5%; white-space: nowrap">
<asp:Label ID="lblClientId " runat="server" Text="Client Id:"></asp:Label></td>
<td style="width: 13%">
<asp:TextBox ID="txtClientId " runat="server" ReadOnly="True" SkinID="Display OnlyTextbox"
Width="56px"></asp:TextBox>
</td>
<td style="width: 5%; white-space: nowrap">
<asp:Label ID="lblClientNa me" runat="server" Text="Client Name:"></asp:Label></td>
<td style="width: 20%">
<asp:TextBox ID="txtClientNa me" runat="server" ReadOnly="True" SkinID="Display OnlyTextbox"></asp:TextBox>
</td>
<td style="width: 3%; white-space: nowrap">
<asp:Label ID="lblSPId" runat="server" Text="Service Placement Id:"></asp:Label></td>
<td style="width: 17%">
<asp:TextBox ID="txtSPId" runat="server" ReadOnly="True" SkinID="Display OnlyTextbox"
Width="56px"></asp:TextBox>
</td>
<td style="width: 5%; white-space: nowrap">
<asp:Label ID="lblReferral ID" runat="server" Text="Referral ID:"></asp:Label></td>
<td style="width: 15%">
<asp:TextBox ID="txtReferral ID" runat="server" ReadOnly="True" SkinID="Display OnlyTextbox"
Width="72px"></asp:TextBox></td>
</tr>
<tr style="display: none">
<td style="width: 5%; white-space: nowrap">
</td>
<td style="width: 13%">
</td>
<td style="width: 5%; white-space: nowrap">
</td>
<td style="width: 20%">
</td>
<td style="width: 3%; white-space: nowrap">
</td>
<td style="width: 17%">
</td>
<td style="width: 5%; white-space: nowrap">
</td>
<td style="width: 15%">
</td>
</tr>
</table>
</Template>
</igmisc:WebGroup Box>
</td>
</tr>
</table>

function ClearScreen()
{
//alert("Anil Test")
var d = document.all;
var e = "";
d.txtClientId.v alue= e;

}


btnCancel.Attri butes.Add("onCl ick", "ClearScreen(); return false;")


Please provide help on this. how to resolve




Thanks




Anil Kumar Dwivedi
Jul 27 '07 #1
1 2679
kenobewan
4,871 Recognized Expert Specialist
I don't see btnCancel in your page?
Jul 27 '07 #2

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

Similar topics

5
4251
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 second form when it is called. Both forms are .htm files that call themselves when the submit button is press via the following command in each form: <form method="post" action="<?php $server?>">
3
2000
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 text 'Hi'. When I click the other button 'button2', it redirects to different page say' Webform2.aspx'. Now if I click the 'Back' menu of the browser, I again get 'webform1.aspx'. Now if I click on 'button1' again then instead of displaying text...
2
1691
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 textboxes and the dropdownlist) and lots more stuff on the page. When the user wants to save the page he'll click the save button. The server gets the postback but I can read out the filled in controls (in my control). The textboxes text = ""...
5
1697
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 user filled in in another page. But suppose there were 3 values. In that case, I know the names of the fields, they are MyTextBox1 MyTextbox2 MyTextbox3
1
12502
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 they loaded. I do this using sajax (basically using java script to go back to the server with out a page refresh). Well my problem comes after that when I click on a state and then say I picked the wrong state and clicked on another state in my...
3
5419
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 I put the function in a for loop like so: for(var i = 0; i < TotalPoints; i++) { Lat = <%= GetNextLatitude()%> Lng = <%= GetNextLongitude()%>
1
7889
by: anilkumar1980 | last post by:
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 (<%@ Page Language="VB" MasterPageFile="~/ServiceReferrals/HCSOS.master" AutoEventWireup="false" CodeFile="HCSOSDetails.aspx.vb" Inherits="HomeCareSOS" %>) then Inculding my js files like <asp:Content ID="HCSoS" ContentPlaceHolderID="HCSOSDetails" runat="server"> <script type="text/javascript" src="../JSUtils/GridUtils.js"></script>...
1
4918
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 order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In the corresponding input field (text box) the user enters a new category order which gets stored in...
1
1795
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 the values entered in al the textboxes Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load If IsPostBack Then Try If Not TextBox1.Text Is String.Empty Then ...
0
8290
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8594
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1596
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.