hi,
> I want to handle the "onclick" event in
> Main.jsp
> in
> stead of in Sub.jsp.
>
I think I misunderstood what you first meant with this :)
if you want that sub.jsp handles a user after he submitted a form in
main.jsp. forward the request
(response.sendRedirect(),request.getRequestDispatcher().forward()...) from
sub.jsp to main.jsp.
if you want (that's what i thought you wanted to know when i first read your
mail) that in sub.jsp and in main.jsp if a user submits a form the same
javascript function is called to verify the form elements or whatever. in
this case you would have a separate file for all your js scripts and the
following syntax in your jsp file to import the js file and to use functions
from it:
code in jsp file:
<script language="javascript" scr="myscripts.js"
text="text/javascript"></script>
...
<form ...>
<input type=button value="Do Something" onClick="doSthWith(6)">
</form>
code in myscripts.js:
function doSthWith(num) {
num +=1;
}
hope this helps.
-mw
----- Original Message -----
From: "Ali Chadorbaf" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 24, 2001 5:31 PM
Subject: Re: Newbie question: How to propagating to handle an event to
another page
> Resend. Please help.
>
>
>
> --- Ali Chadorbaf <[EMAIL PROTECTED]> wrote:
> > Michael,
> > Could you please explain more. Would appretiate
> > sample
> > code if possible. Please advice.
> >
> >
> > --- Michael Weller <[EMAIL PROTECTED]> wrote:
> > > hi,
> > > it's only possble by using javascript. keep a
> > > separate *.js file which
> > > contains all scripts you use in your project. if
> > you
> > > do so, you can call
> > > every js method from every jsp.
> > >
> > > hope this helps.
> > >
> > > -mw
> > >
> > >
> > > ----- Original Message -----
> > > From: "Ali Chadorbaf" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, October 22, 2001 5:42 AM
> > > Subject: Newbie question: How to propagating to
> > > handle an event to another
> > > page
> > >
> > >
> > > > Hi guys,
> > > >
> > > > I have a page (say Main.jsp), which will
> > > instantiate
> > > > another page(say Sub.jsp) when is loaded on
> > > screen.
> > > > Means at the same time user can see both
> > Main.jsp
> > > &
> > > > Sub.jsp on the same screen. (Sub.jsp is called
> > by
> > > > Main.jsp). There is a button on Sub.jsp and
> > > > I want to handle the "onclick" event in
> > Main.jsp
> > > in
> > > > stead of in Sub.jsp.
> > > >
> > > > On the other words, I want to propagate the
> > button
> > > > clicked event from Sub.jsp to Main.jsp Any idea
> > > for
> > > > this?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Make a great connection at Yahoo! Personals.
> > > > http://personals.yahoo.com
> > > >
> > > >
> > >
> >
>
___________________________________________________________________________
> > > > To unsubscribe, send email to
> > > [EMAIL PROTECTED] and include in the
> > > body
> > > > of the message "signoff SERVLET-INTEREST".
> > > >
> > > > Archives:
> > >
> >
> http://archives.java.sun.com/archives/servlet-interest.html
> > > > Resources:
> > >
> >
> http://java.sun.com/products/servlet/external-resources.html
> > > > LISTSERV Help:
> > > http://www.lsoft.com/manuals/user/user.html
> > > >
> > > >
> > >
> > >
> >
>
___________________________________________________________________________
> > > To unsubscribe, send email to
> > [EMAIL PROTECTED]
> > > and include in the body
> > > of the message "signoff SERVLET-INTEREST".
> > >
> > > Archives:
> > >
> >
> http://archives.java.sun.com/archives/servlet-interest.html
> > > Resources:
> > >
> >
> http://java.sun.com/products/servlet/external-resources.html
> > > LISTSERV Help:
> > > http://www.lsoft.com/manuals/user/user.html
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> >
>
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives:
> >
> http://archives.java.sun.com/archives/servlet-interest.html
> > Resources:
> >
> http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help:
> > http://www.lsoft.com/manuals/user/user.html
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html