struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parvat Singh Ranawat" <mailtopar...@gmail.com>
Subject Re: two form one jsp
Date Wed, 02 Aug 2006 13:27:10 GMT
hi ,

The problem in using document.form[0]. and document.form[1] for first and
second form respctively
first form comes from  Header.jsp and second form from myFoo.jsp and Header
is there through out Application
and the functionality that is part of Header that I need to write in
myFoo.jsp there i need to pass same actionForm (This is where problem
occured)..... And also i want myFoo.jsp as part of some Popup functionality
where there is no Header.jsp included so in that case  we have single form
so document.form[1] will not work

please  suggest

Thanx
Shakti


On 02/08/06, Monkeyden <monkeyden@gmail.com> wrote:
>
> Can we please stop suggesting use of the form name?  It.will.not.work.  If
> both forms have the same name, it makes a reference to document.forms
> ['foo']
> an array and not a reference to the form.  Of course you *could *do this:
>
> <html>
> <head>
> </head>
> <script language="JavaScript" type="text/javascript">
> function tellMe(){
>    alert("Form 1: " + *document.forms['foo'][0].form2Text.value*);
>    alert("Form 2: " + *document.forms['foo'][1].form2Text.value*);
> }
> </script>
> <body>
> <form action="foo" method="post" name="foo" id="foo">
>    <input type="text" name="form2Text" value="This is 1">
> </form>
> <form action="bar" method="post" name="foo" id="bar">
>    <input type="text" name="form2Text" value="This is 2">
> </form>
> <input type="button" name="myButton" value="Click It" onclick="tellMe();">
> </body>
> </html>
>
> but A, that would be stupid, and B, you have to use the index value
> anyway.
>
> On 8/1/06, kalpesh modi <modi_kalpesh@yahoo.com> wrote:
> >
> > I am not sure whether
> >
> > document. form['formName'] will work or not. Give it a try.
> >
> > -Kalpesh
> >
> >
> >
> > ---------------------------------
> > Yahoo! Music Unlimited - Access over 1 million songs.Try it free.
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message