Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.form is undefined ??

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
I need another pair of eyes because this is driving me crazy. Granted, i struggle with JS but I'm still learning.

I keep getting the 'document.form1.name46.value is undefined' error but can't see what its wrong. I have this fire when a drop down menu is changed so the page loads without errors until then. I have tried a few different syntax's but keep having the issue at the same point - name46. I even commented that out and the error goes to the next line. Those lines are hidden on load, could that be it?


Code:
(in head)
        function Blank_Entries(temp){
	var temp = parseInt(temp);
        if (temp <= 9) {
		document.form1.CODE28.selectedIndex = 0;
		document.form1.CODE29.selectedIndex = 0;
		document.form1.CODE30.selectedIndex = 0;
		//var theForm = document.getElementById("form1");
		//theForm.name46.value = '';
		//document.forms[0].name46.value = '';
		document.form1.name46.value = '';
		document.form1.name47.value = '';
		document.form1.name48.value = '';
		document.form1.name49.value = '';
		document.form1.name50.value = '';
                ...
                ...

(in body)
                ...
                ...
<div id="Booth10" style="display:none;">
<label for="fname46">First Name</label><br><input type="text" name="fname46" value="" id="fname46" style="width:150px; display:inline;" onkeydown="return tabOnEnter(this, event);" />
...
</div>
 
In your form code the element name is

name="fname46"




Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top