posh020
asked on
How to fill in a text input box with a specified value?
Hi folks,
Suppose I have the following in my JSP page.
<form action="myform.jsp" method="post">
Type Your Value:
<input type="text" name="yourval" size=35
value="${fn:escapeXml(para m.yourval) }">
<font color=red>${fn:escapeXml(y ourvalErro r)}</font>
</form>
The above will give me a text box where I can type some value.
But it will be a blank text box.
I want the text box to have an initial value that shows inside the text box, like "123".
How can I do this?
Also, I want to call <jsp:getProperty name="mybean" property="yourVal" />
and put the value returned by this call, inside the text box as the initial value.
How can I do this?
Thank you.
Suppose I have the following in my JSP page.
<form action="myform.jsp" method="post">
Type Your Value:
<input type="text" name="yourval" size=35
value="${fn:escapeXml(para
<font color=red>${fn:escapeXml(y
</form>
The above will give me a text box where I can type some value.
But it will be a blank text box.
I want the text box to have an initial value that shows inside the text box, like "123".
How can I do this?
Also, I want to call <jsp:getProperty name="mybean" property="yourVal" />
and put the value returned by this call, inside the text box as the initial value.
How can I do this?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.