how to freeze input field in html form

Hello,
    I have a simple form data as below:
      <td>
      <input type="text" name="account type" size="20" maxlength="40" value="some text" ><br>
      </td>

What should I add to the above code so that the text field is frozen or in other words non editable?
kavishshuklaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BogoJokerCommented:
Hi kavishshukla,

readonly!
     <input type="text" name="account type" size="20" maxlength="40" value="some text" readonly><br>


Joe P
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hongjunCommented:
try

<input type="text" name="account type" size="20" maxlength="40" value="some text" disabled ><br>
0
BogoJokerCommented:
Sure thing =)
Joe P
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

hongjunCommented:
or this
<input type="text" name="account type" size="20" maxlength="40" value="some text" onfocus="this.blur()"><br>
0
BogoJokerCommented:
Hehe hongjun those are all nice tricks but I think he was looking for readonly.
Those are all nice tricks and hacks =)
Joe P
0
RoonaanCommented:
Hi kavishshukla,

BogoJoker and hongjun are both right, although there is a slight difference between readonly="readonly" and disabled="disabled".

When you disable a textfield using "disable", then your field will NOT be submitted along with the form. When you use readonly="readonly" the field is just uneditable, but gets to be submitted along with your form.

-r-
0
BogoJokerCommented:
That and the appearence, good morning Roonaan, that is signal for me to go to bed, darn its late!!
Get back into the top 10 =)
G'nite yall
Joe P
0
Ivo StoykovCommented:
Hello kavishshukla,

add disabled between < and >, i.e.
<input type="text" name="account type" size="20" maxlength="40" value="some text" disabled>


HTH

I
0
hongjunCommented:
@BogoJoker

Congrats!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.