[thelist] javascript form submit

Les Lytollis les.lytollis at morse.com
Tue Oct 9 06:19:05 CDT 2001


Hi All,

I am trying to submit a form via a javascript function from an onClick event
of a radio button:
<pre>

<hr>Select length of subscription<hr>
1 Months<input type="radio" name="btnSubLength" value="1"
onClick="refreshForm()"><br>
3 Months<input type="radio" name="btnSubLength" value="3"
onClick="refreshForm()"><br>
6 Months etc...

</pre>

The refreshForm function takes the "btnSubLength" value and displays prices
for the appropriate choice.

<pre>
function refreshForm() {
  var objForm = document.forms[0];
  var strSubLength;
                
  for (var i = 0; i < objForm.btnSubLength.length; i++) {
    if (objForm.btnSubLength[i].checked){
      strSubLength = objForm.btnSubLength[i].value;
    }            
  }
        
  objForm.action = "sub_options.asp?SubLength=" + strSubLength;
  objForm.submit();     
}
</pre>

The problem is I keep getting "Object doesn't support this property or
method" in relation to the objForm.submit()
This is driving me mad because I have seen numerous examples *and* I've done
it before!

If I anyone can point out what I'm doing wrong, I'd be extremely grateful

Lez





More information about the thelist mailing list