Two characteristic properties of the input box

Source: Internet
Author: User
Tags key modify

Use two new properties disabled and ReadOnly:

(1) The Disabled property can mask an action, such as prohibiting the user from selecting, clicking the button or using the TAB key to switch between the different text.

To use the Disabled property in the form label:

<input type= "button" Name= "Donebutton" value= "OK" disabled>

That's what it looks like:

<input type= "text" name= "username" value= "eschool" disabled>

That's what it looks like:

When your site has some functional features not yet completed or temporarily shut down, it is not very good to deal with it?

Note: The value of the area after using the disabled attribute cannot be passed to another program (ASP/CGI), and if you have to pass it, do it by hiding the attribute. That

<input type= "hidden" name= "username" value= "eschool" >

(2) The ReadOnly attribute is "read Only" as the name suggests. It converts text to an object and prevents it from being edited.

<input type= "text" name= "Eschool" value= "1500" readonly>

can modify

Cannot modify

The second area uses the ReadOnly property, although you can switch between multiple text areas by using the TAB key, but you cannot modify the value of the text area that you have specified. But it's not like the disabled property, it can be a normal numeric pass.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.