Creating static text dynamically

liunx

Guest
I need to be able to display a price on a page dynamically. I retrieve data from a database and display it. I only retrieve the data, the page is static.<br />
<br />
I am currently using a input text field, but the user can change the price. How do I create a input text field that cannot be edited or create a static text field?<!--content-->If you want to disable the input field (so that users can't input values), just type DISABLED in the <input> tag.<!--content-->Thanks for the info. The only problem is that I am very new to html and I am not sure how/where in the input tag I do this. For examle, in style, there is a certain format. How is this formatted? Here is the code:<br />
<br />
<input type="text" size="8" name="Price1"<br />
value="$<%=InvPrice("293818-001")%>.00"<br />
style="font-family: Verdana; font-size: 8pt; font-weight: bold; vertical-align: middle; border: medium"<br />
medium none><br />
<br />
Thanks!<!--content-->Using DISABLED in the tag worked, but left the text gray. I did some more digging at MicroSoft and discovered CONTENTEDITABLE. By setting this to false, CONTENTEDITABLE=false and placing it in the tag instead of DISABLED, I was able to keep the formatting of the text.<br />
<br />
Again, thanks for your help and assistance. You definitely pointed me in the right direction!<br />
:D<!--content-->you want to use readonly in the input tag, not disabled.<!--content-->Why not use CONTENTEDITABLE=false? What are the diferences/advantages/disadvantages of these directives? I need the ability to set these values dynamically, depending on the values retrieved from the database.<!--content-->ask yourself where you got that from? I bet you said M$. well that is your biggest disadvantage. it will only work on IE and in NS or opera or mozilla or any other one you will be able to change it. using readonly keeps teh format and it will not be greyed out but can be selectable, just can't be changed.<br />
<br />
<br />
did you try it?<!--content-->You are right, I did get it off M$. :O@ I did change it and it appears to have the same effect.<br />
<br />
Where can I go to look at documentation as to keep the html as generic (non-M$ specific) as possible?<!--content-->there really isn't any one place. but you can read <!-- w --><a class="postlink" href="http://www.w3c.org">www.w3c.org</a><!-- w --> as they set the standard for all browsers.<br />
<br />
you will just have to experiment with each browser because you will heve problems down the road if you travel this web experience for very long, I can almost garauntee that.<!--content-->
 
Back
Top