Solved

jsp out.println

Posted on 2007-03-29
3
2,430 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 50 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

628 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