null or not a object

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

  • : 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:mac_doggie@hotmail.com
    the Netherlands...


Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion