Passing form name and form object names to functions
<p>I'm having trouble understanding the workings of Javascript...I want to pass a form name and the submit button name so that the function can evaluate a passed value and either enable or disable the submit button.  </p>

<p>It works if I explicitly use the names but I'd like it to work dynamically.  Unfortunately I just am not understanding how to correctly use these arguments.</p>

<p>Right now the first document statement works (form name and button name are used), why doesn't the second, where arguments are used?  I know from the alert that the form name isn't correct and can't be used as is but this won't work even if I explicitly name the form but use the passed button name which does appear correct.</p>

<p>I know this must be javascript 101 but I run into this time and again and am just not getting what's what.  Anyone willing to explain this to me?</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function aTest(formName,objName,val){
       if (val&lt;5){
         document.aForm.aBtn.disabled=false;
         alert(formName+" - "+objName);
          }
       else {
         document.formName.objName.disabled=true;
          }
    }//end function aTest(formName,objName)
&lt;/script&gt; 

&lt;form name="aForm"&gt;
&lt;input name="testFld" type="text" onBlur="aTest(this.form,'aBtn',this.value)"&gt;
&lt;input name="aBtn" type="submit" value='submit'&gt;&lt;/form&gt;
</code></pre>

<p>Thank you for your kind attention!</p>
