Hi Leena..
 Here is one solution
 see the sample.jsp below

put your message in the
 <input type="hidden" name="msg1" value="<%= request.getParameter("nameFld")
%>">
 to replace ="<%= request.getParameter("nameFld") %> and  check
--------------------------------------------------
<html>
<head>
<script>
function callTest(){
 alert( document.testForm.msg1.value );
}
</script>
 </head>
<body onLoad="callTest()">
<form name="testForm">
<input type="hidden" name="msg1" value="<%= request.getParameter("nameFld")
%>">
</form>
</body>
 </html>

there may be better solutions !!

Jeevan
> -----Original Message-----
> From: Leena Albert [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, September 04, 2000 5:17 AM
> To:   [EMAIL PROTECTED]
> Subject:      Can i use java objects in Javascript
>
> Hi,
>        In JSP, I would like to use instances in JavaScript using JSP tags.
> Will it be possible?
>
>  I am having a interface Which declares constants, i.e, fields like
> MSG01="You have to fill the textbox". In javascript, on field validation,
> if i call the message with instance msg as <%= msg.MSG01 %> it, gives
> "object undefined error".
> How can i access it in javascript, as i need to declare the error
> messages(MSG01) in interface?
>
> form name=actform and textbox name = txt1,
>
> Code is
> ------------------------------------
> if (actform.txt1==""){
> alert(<%= msg.MSG01 %>);
> }
>
> Thanks in advance,
>
> A.Leena
>
> _________________________________________________
> Get Your Free Email At, http://www.rediffmail.com
>
> Partcipate in crazy Re.1 auctions at http://www.rediff.com/auctions
>
> ==========================================================================
> =
> 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

Reply via email to