Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jsp out.println

Posted on 2007-03-29
3
Medium Priority
?
2,431 Views
Last Modified: 2008-02-01
I have a JSP which has a bunch of output statements that creates textboxes etc.
I know it is bad design - however,it is code that I inherited.I wold like to add an option list with US selected.,but I am getting an error.
out.println("<tr><td width=\"30\">"<SELECT NAME=\"country\" id=\"country\" class=\"dataInputs\">");
                      out.println("<option value='us' selected='selected' ">USA");
                      out.println("<option value='ca'">CANADA");
out.println("</select>");
I thik I have not closed the tags properly- can someone point me to the right place?
0
Comment
Question by:aswam1975
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
stanscott2 earned 200 total points
ID: 18819038
out.println("<tr><td width=\"30\">"<SELECT NAME=\"country\" id=\"country\" class=\"dataInputs\">");

There shouldn't be a double-quote between the end of the TD tag and the beginning of the SELECT tag.  Because it's often easier to read, whereever possible I use single quotes internally, and reserve outer quotes to the outside of the entire string, but if you correct this error it should work.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question