The server obtains the textbox value set to readonly.

Source: Internet
Author: User

Generally, if the cursor field does not need to be used, the readonly encoding of textbox is set to true. However, after this setting, if Javascript is used to change the textbox value on the client side, this value cannot be used to control the corresponding textbox.

When the textbox controls the processing of the PostBack data, if the value of readonly encoding is true, it will not return to text encoding, so you should modify the textbox. text certainly does not apply to the latest value at the front end. You can see through the page. request. form to obtain the front-end textbox value. Why does Textbox Control the design like this? The main reason is that it increases the security of the website and prevents the bot program from modifying the website's unique location.

In the following example, a unique Textbox Control Plane is placed on the plane. If the front-end JavaScript changes to the control plane value, you can obtain a new value through page. Request. form. But page. request. in form ("textbox1"), "textbox1" does not control the sequence ID, but the name in the client-side HTML sequence, which is equivalent to controlling the uniqueid Sequence Value of the sequence.

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.