null or not a object - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

null or not a object

crmpiccocrmpicco Posts: 12Member
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 tag:






But i keep get this error:

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

However, it is DEFINATELY there:



">
">




Comments

  • mac_doggiemac_doggie Posts: 488Member
    : 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 tag:
    :
    :
    :
    :
    :
    :
    : But i keep get this error:
    :
    : document.fexp.multileg.value is null or not a object.
    :
    : However, it is DEFINATELY there:
    :
    :
    :
    : ">
    : ">
    :
    :
    :
    :
    :
    try this:
    [code]
    function submitvalues()
    {
    if ((document.forms['fexp'].elements['multileg'].value == true)&&(document.forms['fexp'].elements['submitcounter'].value == true))
    {
    document.forms['fexp'].submit();
    document.forms['fexp'].elements['multileg'].value == false;
    document.forms['fexp'].elements['submitcounter'].value == false;
    }
    }

    [/code]
    ;-)
    -mac-
    mailto:[email protected]
    the Netherlands...


Sign In or Register to comment.