Javascript innertext instead of disabled

T

Totti

Hi all,

I have made a form in HTML that takes user input validates it with
Javascript and print it back in a proper way, for the printing work i
used text fields that i disabled, so you know now they are grey boxes
and the characters inside are not so clear for the user eye, the other
thing is that i dont like the way they look, I asked somebody dor an
improvement he suggested innertext using tables. i searched the
internet i actually didnt understand much about what innertext are all
about or how they are use.

Would anyone please provide me with any good links or info. about
their proper use in order to switch from disabled text boxes to this
"technology"

any help appreciated!
 
L

Laser Lips

Hi all,

I have made a form in HTML that takes user input validates it with
Javascript and print it back in a proper way, for the printing work i
used text fields that i disabled, so you know now they are grey boxes
and the characters inside are not so clear for the user eye, the other
thing is that i dont like the way they look, I asked somebody dor an
improvement he suggested innertext using tables. i searched the
internet i actually didnt understand much about what innertext are all
about or how they are use.

Would anyone please provide me with any good links or info. about
their proper use in order to switch from disabled text boxes to this
"technology"

any help appreciated!

You can not put fancy HTML into text fields. Only text. You can style
the text fields using CSS but when you disable it, the browser will
always override your styling to show that its disabled.
It sounds like once they have entered text and you validate it you
take away the option to edit it by disabling the text box. If that is
the case and you want to make the text look pritty why dont you remove
the text box and display the text in a div....Then you would use the
innnerHTML method of JavaScrip to do this.
 
D

David Mark

You can not put fancy HTML into text fields.  Only text. You can style
the text fields using CSS but when you disable it, the browser will
always override your styling to show that its disabled.

Some browsers will. Some won't.
It sounds like once they have entered text and you validate it you
take away the option to edit it by disabling the text box.  If that is
the case and you want to make the text look pritty why dont you remove
the text box and display the text in a div....Then you would use the
innnerHTML method of JavaScrip to do this.

There is no such thing as an "innerHTML method" and them term
"innerHTML" is not in the JS specs.

To make inputs read-only, set their readOnly property. To prettify
them for printing, use a style sheet. Or use standard DOM methods to
create whatever structure you like with the values (best to avoid the
innerHTML and innerText properties.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top