We are displaying some text in text box coming from database. We set this value in text box using one Js function. Problem is that the string from DB is "My Name". In textbox it should be displayed as "My Name", but it gets displayed as "My Name".
How to solve this problem?
My HTML for text box is as follows,
<input type="text" class="textfield" id="searchText">
Note : Can’t change the value returned from DB.
Using javascript->java->ORACLE to pull value from the DB.
This works by creating a temporary element and filling its
.html()with your database string. Then the raw.text()is extracted from that and passed to your input element. Any HTML entity will be replaced by the corresponding character.This is an ugly hack. I strongly suggest fixing your database values instead.