Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Simple question I hope


Message #1 by "Debreceni, David" <david_debreceni@r...> on Fri, 9 Aug 2002 14:27:42 -0400
Thanks to John and Jerry for responding.  We ended up solving the problem a
couple of minutes ago.  This is what we used on the form and it seems to
work. This is triggered by a button on the form.  Thanks again for your
help.

for(i = 0; i < document.forms.frmContract.length; i++)
{
	if(document.forms.frmContract.elements[i].getAttribute("type") ==
"text") 
 		document.forms.frmContract.elements[i].value = "0";
} 


 
 
David Debreceni
Senior VB/ASP Developer
David_Debreceni@r... <mailto:David_Debreceni@r...> 
xxx-xxx-xxxx  x1086


-----Original Message-----
From: Boloian, John [mailto:jboloian@u...]
Sent: Friday, August 09, 2002 3:31 PM
To: javascript
Subject: [javascript] Re: Simple question I hope


David,

One thought to your problem is to give the textboxes you need changed on
your page an id with a unique prefix (for example, "txt_1", "txt_2" etc.),
then loop through all text boxes. Then use the substr(0, 4) method to match
all of the ids within the loop that match "txt_", and set those to Zero
(using getElementById).

This would work with ie 5+ and NS6 only though...

--jb

-----Original Message-----
From: Debreceni, David [mailto:david_debreceni@r...]
Sent: Friday, August 09, 2002 3:12 PM
To: javascript
Subject: [javascript] Re: Simple question I hope




---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20


  Return to Index