• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JspWriter for Devloping Custom Tag

 
srujana maredugu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to develop custom tag for getting the circles in drop down box.
i am trying to add circles with spaces like (Andhra Pradesh,Tamil Nadu etc).
But in javascript i am not able get the full name.

Please find this code:

HttpServletRequest req=(HttpServletRequest)pageContext.getRequest();
JspWriter out=pageContext.getOut();

out.print("<html>");
out.print("<body>");
out.print("<form name=circleform method=GET>");
out.print("circle:<select name=circles onchange=getCircle(this)>");
out.print("<option>select</option>");
while(rs.next())
{

out.print("<option value=Andhra Pradesh>Andhra Pradesh</option>");
}
out.print("</form>");
out.print("</body>");
out.print("</html>");


but same i am trying in javascript function , i am getting like 'Andhra' only not full name.

Please suggest me how to get full name if it contains spaces

Thanks & Regards
Srujana
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srujana,

Have tried with single or double quotes i.e
"<option value='Andhra Pradesh'>Andhra Pradesh</option>"
OR
"<option value="Andhra Pradesh">Andhra Pradesh</option>"

But in out.print method you have to esacpe the quotes with the help of \ character.

Hope,this is what you are expecting.

Regards
Baseet Ahmed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic