Daryani Santosh wrote:
>
> Create a button , On click of this button
> put button value in a variable
>
> The button has to submit a form , if you want to do it without submitting the
> form
> go to Method2
>
> <%
> if request.getParameter("button_name") != null
> {
> String btnValue = request.getParamter("button_name")
> if btnValue.equals("setProperty")
> <jsp:setProperty name="" value="" >
> or
> <jsp:setProperty *  > //star sets all
> }
> %>
>
> Method2
>
> <Input type = text name = field 1 onBlur="setproperty()">
>
> <script >
> function setproperty()
>
> {
> <%
> <jsp:setProperty . . . . .>
>
> %>
>
> I am not 100% sure about method 2 , but I think it should work
>
> }
>
> </script>

No, the second method will not work. Remember, JavaScript code
executes in the browser, JSP code executes on the server; you
can't mix the two like this.

See <http://TheJSPBook.com/faq/details.jsp?id=1003> for more
on this.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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

Reply via email to