Thanks ! it works like a charm ...

----- Original Message -----
From: "Olga Agady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, August 18, 2002 12:47 AM
Subject: Re: form submit() method is not recognized.


> Hi, Ganesh
>
> I have good news: I found a solution to this problem
> in struts-user archive. The following is a snippet
> from an old message:
> __________________________
>
> I spent a good hour hunting down the source of my
> problem with trying to programmatically submit a form
> and thought I'd share the solution for others who are
> using struts. I wanted to have a select list
> automatically cause its containing form to submit when
> the value of the select list changed. This is useful
> for simple sorts or subsearches in a search result
> list.
>
> In my JSP page, I had the following code:
>
> <html:select property="mySelectName"
>              onchange="this.form.submit()">
>   <html:options name="mySelectOptionCollection">
> </html:select>
>
> I kept getting "Object doesn't support this property
> or method" from my browser. Finally I figured out that
> by default, struts gives <html:submit/> tags a name of
> "submit". Thus there was a namespace collision in the
> form object, with the submit button overriding the
> form's submit method. I fixed the problem by changing
> the name of the submit button. Something like this
> works great:
>
> <html:submit property="submitProperty" value="The
> Label I Want"/>
>
> Perhaps the default name for submit buttons could be
> changed in struts in the future to avoid such
> namespace collisions, especially with very standard
> methods and properties like form.submit?
>
> ________________________
>
> Regards
> Olga
>
>
> --- Ganesh Puri <[EMAIL PROTECTED]> wrote:
> > Hi Olga,
> >
> > Try in netscape ... and on getting the error type
> > javascript: in the
> > location window
> > I get something like this ...
> >
> >
> > ----- Original Message -----
> > From: "Olga Agady" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>
> > Sent: Saturday, August 17, 2002 10:03 PM
> > Subject: RE: form submit() method is not recognized.
> >
> >
> > > Hi, Oz
> > >
> > > I am actually not sure that this is not a struts
> > > problem. Looks like it is. I replaced my jsp page
> > with
> > > the HTML page which has exactly the same fields
> > and
> > > scripts, but doesn't use struts, just HTML tags
> > > <FORM>, <INPUT> and <SELECT>. On this HTMl page
> > this
> > > script works. It doesn't find the the action,
> > because
> > > the action is not mapped to this page, but it
> > submits
> > > the form from the script
> > "document.forms[0].submit()"
> > > and doesn't show me that strange error which I get
> > > when using struts.
> > >
> > > Olga
> > >
> > >
> > > --- Oguz Kologlu <[EMAIL PROTECTED]>
> > wrote:
> > > > It's not actually a problem with struts - you
> > can't
> > > > submit
> > > > from a select.
> > > >
> > > > Oz
> > > >
> > > > -----Original Message-----
> > > > From: Jacob Hookom [mailto:[EMAIL PROTECTED]]
> > > > Sent: Sunday, 18 August 2002 8:52 AM
> > > > To: 'Struts Users Mailing List'
> > > > Subject: RE: form submit() method is not
> > recognized.
> > > >
> > > >
> > > > Try doing something small first, like doing
> > > > alert(document.forms[0].country.value) and see
> > if
> > > > you even get that,
> > > > then you can start to determine your error.
> > > >
> > > > | -----Original Message-----
> > > > | From: Olga Agady [mailto:[EMAIL PROTECTED]]
> > > > | Sent: Saturday, August 17, 2002 4:57 PM
> > > > | To: Struts Users Mailing List
> > > > | Subject: form submit() method is not
> > recognized.
> > > > |
> > > > | Hello,
> > > > |
> > > > | I am using struts 1.0.2. I experience a wierd
> > > > problem:
> > > > | When I submit the form after a user selects an
> > > > item
> > > > | from a drop-down select box:
> > > > |
> > > > | <html:select property="country"
> > > > | onchange="document.forms[0].submit()">,
> > > > |
> > > > | I get run-time error that "Object doesn't
> > support
> > > > a
> > > > | property or a method". I tried to re-write the
> > > > code
> > > > | with different variations like:
> > > > |
> > > > | <html:select property="country"
> > > > | onchange="submitForm()">,
> > > > |
> > > > | <SCRIPT>
> > > > | function submitForm(){
> > > > | document.forms[0].submit();
> > > > | }
> > > > | </SCRIPT>
> > > > |
> > > > | Whatever I do, when the script starts running
> > the
> > > > line
> > > > | document.forms[0].submit(), I get the same
> > error.
> > > > | Looks like submit() method is not recognized.
> > Did
> > > > | someone have a similar problem?
> > > > |
> > > > |
> > > > | Thanks,
> > > > | Olga
> > > > |
> > > > |
> > > > |
> > > > |
> > __________________________________________________
> > > > | Do You Yahoo!?
> > > > | HotJobs - Search Thousands of New Jobs
> > > > | http://www.hotjobs.com
> > > > |
> > > > | --
> > > > | To unsubscribe, e-mail:   <mailto:struts-user-
> > > > | [EMAIL PROTECTED]>
> > > > | For additional commands, e-mail:
> > > > <mailto:struts-user-
> > > > | [EMAIL PROTECTED]>
> > > > |
> > > > | ---
> > > > | Incoming mail is certified Virus Free.
> > > > | Checked by AVG anti-virus system
> > > > (http://www.grisoft.com).
> > > > | Version: 6.0.381 / Virus Database: 214 -
> > Release
> > > > Date: 8/2/2002
> > > > |
> > > >
> > > > ---
> > > > Outgoing mail is certified Virus Free.
> > > > Checked by AVG anti-virus system
> > > > (http://www.grisoft.com).
> > > > Version: 6.0.381 / Virus Database: 214 - Release
> > > > Date: 8/2/2002
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > >
> > <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > >
> > <mailto:[EMAIL PROTECTED]>
> > > > For additional commands, e-mail:
> > > > <mailto:[EMAIL PROTECTED]>
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > HotJobs - Search Thousands of New Jobs
> > > http://www.hotjobs.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to