This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Replacing the drop down box to text field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Replacing the drop down box to text field" Watch "Replacing the drop down box to text field" New topic
Author

Replacing the drop down box to text field

Perumalla LakshmanaRao
Greenhorn

Joined: Sep 03, 2006
Posts: 9
Hi All,
My problem is,I have one jsp page,in that I have one filed Risk Level but it is a drop down box.Now I want to change it as a text field.In that drop down list I have four fields like critical,medium,high,low.But now I want to convert it as a text field with value as critical.But in jsp it is like as

<input type='hidden' name='<%= riskLevelName_hidden%>' value='<%= riskLevelValue%>' />

<select name='<%= riskLevelName%>' onchange='fn_OnClickRiskLevel(<%= index%> ' class="textfield">

<%
if ( "CRITICAL".equalsIgnoreCase( riskLevelValue ) )
{
%>
<option value='CRITICAL' selected>Critical</option>
<%
}
else
{
%>
<option value='CRITICAL'>Critical</option>
<%
}
%>
<%
if ( "HIGH RISK".equalsIgnoreCase( riskLevelValue ) )
{
%>
<option value='HIGH RISK' selected>High</option>
<%
}
else
{
%>
<option value='HIGH RISK'>High</option>
<%
}
%>
<%
if ( "MEDIUM RISK".equalsIgnoreCase( riskLevelValue ) )
{
%>
<option value='MEDIUM RISK' selected>Medium</option>
<%
}
else
{
%>
<option value='MEDIUM RISK'>Medium</option>
<%
}
%>
<%
if ( "LOW RISK".equalsIgnoreCase( riskLevelValue ) )
{
%>
<option value='LOW RISK' selected>Low</option>
<%
}
else
{
%>
<option value='LOW RISK'>Low</option>
<%
}
%>
according to risklevelvalue that options is changing.How I will convert it into text field.Iam sending my entire jsp code.Pleae help to me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replacing the drop down box to text field
 
Similar Threads
help: getParameter returning null!
Show a hidden text field
JSTL tags
Getting the selected option
Null vs empty string