0

Hi how can I replace "null" from being displayed with an empty string in a textbox on the JSPs ..depending on textbox data availability..
I tried the code

<% String phone=userInfoObj..getPhoneno();
if(phone==null||phone.equalsIgnoreCase("null"))
phone=" ";
%>		
<td >
<input type="text" name="phoneno" class="txtBox" value="<%=phone %>"></td>

but still it displays null


can you suggest by using java or javascript?

<% String phone=userInfoObj..getPhoneno();
if(phone==null||phone.equalsIgnoreCase("null"))
phone=" ";
%>		
<td >
<input type="text" name="phoneno" class="txtBox" value="<%=phone %>"></td>
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by maria_megha
0

>can you suggest by using java or javascript?

You can't use JavaScript code.

<% 
String phone=userInfoObj.getPhoneno();
if(phone==null)
   phone="";
%>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.