467,114 Members | 1,241 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,114 developers. It's quick & easy.

Displaying the result in a html label.(is it possible?)

100+
This may be very dumb question, but still...I am displaying a value in a input tag with the value shown as readonly...

Expand|Select|Wrap|Line Numbers
  1. <input type=text size=18 maxlength=50 name="company" value=<%=companyCode %> readonly>
where <%=companyCode%> is the result that is being displayed. Can i display the result in a html label or something similar which is not editable/non-readonly(if i can say that). Just displaying the text. The result of the companyCode is retrieved in my class and in a sql query. So the value will be passed around across class/jsp page. appreciate any help.

regards,

ajos.
Mar 13 '08 #1
  • viewed: 1364
Share:
1 Reply
ronverdonk
Expert 4TB
You can use JavaScript to make the field either ReadOnly or Disabled. Sample
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function makeReadOnly()
  3. {
  4. document.getElementById("text1").readOnly=true;
  5. }
  6. function disableField()
  7.   {
  8.   document.getElementById("text1").disabled=true
  9.   }
  10. </script>
Ronald
Mar 15 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Coco | last post: by
reply views Thread by Fronky | last post: by
3 posts views Thread by Doug (dtism) | last post: by
11 posts views Thread by dba | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.