[thelist] javascript form submit

Tab Alleman talleman at RealMetros.com
Tue Oct 9 11:20:18 CDT 2001


Without currently being able to look at my previous successful examples
of this, and therefore just grasping at straws, do you specify a Method
in your <form> tag?  If not, you may need to.. if yes, maybe put it in
the function along with the .action specification.

sorry if it's the wrong straw.


-----Original Message-----
From: Les Lytollis [mailto:les.lytollis at morse.com]
Sent: Tuesday, October 09, 2001 7:23 AM
To: 'thelist at lists.evolt.org'
Subject: [thelist] javascript form submit


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


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list