Solved

jsp out.println

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now