codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  null or not a object  crmpicco at 11:44 on Wednesday, March 30, 2005
 

I have a form called 'fexp' and two hidden fields called 'multileg' and 'submitcounter', and they both have values of 'true' to start with. I have a Javascript function as per below:



function submitvalues()
{
if ((document.fexp.multileg.value == true)&&(document.fexp.submitcounter.value == true))
{
document.fexp.submit();
document.fexp.multileg.value == false;
document.fexp.submitcounter.value == false;
}
}



I call it in the <body> tag:


<body bgcolor="#f5f5f5" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 onload="setframe();document.fexp.depapt.focus();return submitvalues();">



But i keep get this error:

document.fexp.multileg.value is null or not a object.

However, it is DEFINATELY there:



<input type="hidden" name="multileg" value="<%=multileg%>">
<input type="hidden" name="submitcounter" value="<%=submitcounter%>">



  Re: null or not a object  sels at 13:44 on Wednesday, March 30, 2005
 

see the following code

<html>
<script>
function comeon()
{
alert(document.forms[0].value1.value);
if ((document.forms[0].value1.value.match(true))&&(document.forms[0].value2.value.match(true)))
{
alert("value is True");
}
else
{
alert("Value is not True");
}
}
</script>
<body onload="comeon()">
<form>

<input type=hidden value="true" name="value1">
<input type=hidden value="true" name="value2">

<input type="button" value="button" name="Submit" onclick="comeon()">
</form>
</body>
</html>


if u not satisfied with this code send u'r code fully
then only i can identify error .
while comparing strings in Javascript don't use == operator use match function
thanks.

  Re: null or not a object  dev_noob at 16:18 on Monday, April 04, 2005
 

try this...
u use forms elements after the submit.... may be this cause u js bugs...


function submitvalues()
{
if ((document.fexp.multileg.value == 'true')&&(document.fexp.submitcounter.value == 'true'))
{
document.fexp.multileg.value = 'false';
document.fexp.submitcounter.value = 'false';
document.fexp.submit();
}
}









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Cheap SSL Certificate Coupon Codes, RapidSSL Certificate @ $7/Yr
•  Re: Stored procedure do not return recordset
•  Re: Problem in Calling Stored Proceedure from ASP
•  Re: Customizable Event Calender, using C#
•  Re: script modification: show div on mouseover
•  Re: javascript, get the color assigned by class
•  Re: import contacts of msn/yahoo
•  Re: Incrementing a date field using javascript via prompt
•  Re: I need a code to make a forum on a website


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011