Click to See Complete Forum and Search --> : Jsp ?


ssn2010
06-02-2004, 09:19 AM
I'm leaning JSP as I go, and have a question for you guys............

I would like to be able for a user to click a button, "Put On Vacation", and another JSP page, "PutOnVacation.jsp", be called without having the user actually being directed there. The JSP page being called only calls a method from another java class that runs a SQL statement. Currently I am using the lines:

<form name="putOnVacation" action="PutOnVacation.jsp" method="post">
<td id="vacationBox1">
<input type="submit" value="Put On Vacation" onClick="putOnVacation()">
</td>
</form>

Any ideas. I figure there is just some syntax I'm unaware of. Thanks......

buntine
06-04-2004, 01:11 AM
Java Server Pages is a server-side language, so you cant execute JSP code from the client.

Your calling a JavaScript function from the onclick event. JavaScript is not JSP, nor is it related in any way. So, you cannot call a JS function to execute a JSP script without sending something to the server.

Does this make sense to you?

Regards,
Andrew Buntine.