[wplug] [OT] Javascript help with submit function
Henry Umansky
hmust2+ at pitt.edu
Wed Feb 19 13:21:46 EST 2003
Try making a button called <button onClick="Javascript:newAction()"> within
your form tag. You don't have to pass the form's name through the
function, Javascript will know the function's name either through the name
attribute in the form tag, or through the javascript array of
document.form[x] where x is the number of forms on your webpage, starting
at 0. Then when you submit try doing document.form[x].submit() or
document.frmName.submit().
--On Wednesday, February 19, 2003 12:58 PM -0500 Russ Schneider
<russpgh at stargate.net> wrote:r
> I know this is a Linux mail list, but I have a javascript problem that's
> really buggin' me and no one can solve it. I was hoping someone on this
> list could help. Forgive me if this is a big taboo.
>
> I've created a simple function:
>
> <script language="javascript">
> <!--
> function newAction(newForm) {
> newForm.action = "email.asp";
> newForm.submit();
> return true;
> }
> //-->
> </script>
>
> Basically, I have two buttons. One is a "submit" button, and the other,
> calls this function which is supposed to change the action of the form
> and submit it.
>
> However, I keep getting a "newForm.submit() is not a function" error.
> From the JavaScript manual (
> http://developer.netscape.com/docs/manuals/communicator/jsref/form1.htm#1
> 010966 ) it appears that my syntax and usage is correct, but alas, no
> dice.
>
> One thing that does NOT appear to be an issue is that I do not have a
> button named "submit", nor do I have any element on the page named
> "submit", so that does not appear to be the problem.
>
> Any suggestions?
>
> --
> ___________________________________
> Russ Schneider (a.k.a. Sugapablo)
> http://www.sugapablo.com
>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
Henry Umansky
hmust2 [at] pitt [dot] edu
http://www.pitt.edu/~hmust2
More information about the wplug
mailing list