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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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


Sign In or Register to comment.