You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bart Moberts <st...@hotmail.com> on 2001/05/10 09:49:24 UTC

Re: document.testbean.submit is not a function

Hello John

>From: john.miaso@digitools.com (John Miaso)
>Reply-To: struts-user@jakarta.apache.org
>To: struts-user@jakarta.apache.org
>Subject: document.testbean.submit is not a function
>Date: Wed, 09 May 2001 08:27:24 -0600
>
>I've modified the html-select.jsp example to include the script:
>
><SCRIPT>
>function cbChanged() { document.testbean.cbSearch.value = "Search"
>                        document.testbean.submit()
>}
></SCRIPT>
>
>I'm setting a hidden property so that I can fill a select elements options 
>in
>the Action peroform method based on the selection made in another select
>element. When I do this I get the JSP error: document.testbean.submit is 
>not a
>function.

Isn't that a JavaScript error?

I got this error when I tried to submit a form using a link. I removed all 
the regular submitbuttons and then it worked.

>I get the same result if I try to send reset rather than submit. Is 
>Javascript
>unaware of the submit button property? Is there a better way to approach 
>this?
>
>John Miaso
>

Grtz Bart
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Re: document.testbean.submit is not a function

Posted by John Miaso <jo...@digitools.com>.
Bart,

  I did find the source of this problem. If the submit button is named the
default property value of "submit", Javascript assumes that the button is being
referred to, not the function when the form.submit() request is processed. By
using the property tag and a value other than "submit", JavaScript is no longer
confused.

John Miaso

Bart Moberts wrote:

> Hello John
>
> >From: john.miaso@digitools.com (John Miaso)
> >Reply-To: struts-user@jakarta.apache.org
> >To: struts-user@jakarta.apache.org
> >Subject: document.testbean.submit is not a function
> >Date: Wed, 09 May 2001 08:27:24 -0600
> >
> >I've modified the html-select.jsp example to include the script:
> >
> ><SCRIPT>
> >function cbChanged() { document.testbean.cbSearch.value = "Search"
> >                        document.testbean.submit()
> >}
> ></SCRIPT>
> >
> >I'm setting a hidden property so that I can fill a select elements options
> >in
> >the Action peroform method based on the selection made in another select
> >element. When I do this I get the JSP error: document.testbean.submit is
> >not a
> >function.
>
> Isn't that a JavaScript error?
>
> I got this error when I tried to submit a form using a link. I removed all
> the regular submitbuttons and then it worked.
>
> >I get the same result if I try to send reset rather than submit. Is
> >Javascript
> >unaware of the submit button property? Is there a better way to approach
> >this?
> >
> >John Miaso
> >
>
> Grtz Bart
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.