// taking "|" as a separator str = m_startDate+"|"+m_endDate+"|"+m_title+"|"+m_desc+"|"+m_flag+"|"+m_featured+"|"; %> <option value = "<%= str %>" > <%= m_id %>
<% }
resultset.close(); resultset = null;
}
%> </SELECT></TD> The problem is the contents of title contains <B> , </B> , <A> , <P> Now when I try to display these in the list box there are unpredictable results since the angular tags like '<' ans '>' is being taken as end of the tag itself for eg <input type="text" value="<B>Hello World</B>" > , How do I escape the html tags while I display them in the list box ? For your reference, I am giving below the contents of m_title and m_desc SQL rjanapareddy@MJSTRND> SELECT CURR_EVENT_TITLE FROM MJST_CURRENT_EVENTS WHERE CURR_EVENT_ID='2';
CURR_EVENT_TITLE -------------------------------------------------------------------------------- <B>RADIO:</B><BR><a target="_blank" href="http://majestic.ea.com/home/view.jsp?l ink=http://www.coasttocoastam.com">Coast to Coast A.M.</A>, hosted by Mike Siege l
SQL rjanapareddy@MJSTRND> SELECT CURR_EVENT_DESCRIPTION FROM MJST_CURRENT_EVENTS WHERE CURR_EVENT_ID='2';
CURR_EVENT_DESCRIPTION -------------------------------------------------------------------------------- 10:00 PM-2:00 AM Pacific.<P> Guest: Scott Corales. Corrales is the Editor of INE XPLICATA, and Director of Institute of Hispanic Ufology. The Institute was organ ized in 1999 to serve as a clearinghouse for UFO and paranormal information orig inating from Central America, the Caribbean, South America and Spain.
SCJP, SCJD, SCWCD, SCBCD, SCEA
maha anna
Ranch Hand
Joined: Jan 31, 2000
Posts: 1467
posted
0
Ravindra, PLease refer to this discussion. We have to escape < with < and > with &rt; Of course I made a silly mistake in the sample code. Please refer to Frank's corrected version. regds maha anna http://www.javaranch.com/ubb/Forum7/HTML/001131.html [This message has been edited by maha anna (edited April 17, 2001).]