Nono, you've got to understand the difference between the java/JSP code that
runs on the server and
javascript code that runs on the client.
You cannot run a function on the server triggered from an event on the
client in a single page, like you're trying to do.
One thing you can do is to use JSP to dynamically generate a javascript
function that responds to an event.
Another solution is to perform the function in another request (same or
other page).
Geert 'Darling' Van Damme
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Brenda Tung
> Sent: dinsdag 2 mei 2000 10:34
> To: [EMAIL PROTECTED]
> Subject: use Javascript in JSP
>
>
> hi all,
>
> i have a problem in embedding javascript in JSP. do i do this :
>
> <%!
> function checkFields(changepasswdform) {
>
> my whole javascript code for checkFields goes here
>
> %>
>
>
> <form ..... onSubmit="return checkFields(changepasswdform);">
>
> however, i have an error saying identifier expected. can anyone help ?
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets