ASP. Javascript Operations TextBox Property Application ()

Source: Internet
Author: User

If a control isdisabledIt cannot be edited andIts content was excluded when the form was submitted. If a control isreadonlyIt cannot be edited, but its content (if any) is still included with the submission.

That is: When Readonly=true, the control ID can still be queried the day before and after. When the diabled=true, or when the visible=true, once the form is submitted by the foreground, its ID will no longer be recognized by the foreground, at this time, the TextBox space and the label space function will be similar.

In the actual code, because of the limitations of the label control, many times the TextBox control is borrowed, but the display is the same as the label. The following code

<asp:textbox id= "lblcomment" runat= "Server" width= "$" readonly= "true" visible= "true" borderwidth= "0px" borderstyle= "None" >

</asp:Textbox>

The simple analysis is as follows: Setting BorderWidth to 0,borderstyle is set to none, and its display will be the same as label. ReadOnly is set to True, inner text will not be edited.

The following adds a JS control property to modify the function

function Showcomment (Selectedcontrol, Control1, Control2, Judgepara, Width1, Width2, msg) {if (control1! = null && Amp            Control2! = null) {if (Selectedcontrol.value = = Judgepara) {control1.value = msg;        Control2.style.width = width1;            } else {control1.value = "";        Control2.style.width = Width2; }    }}

Its invocation method

<aspx:textbox id= "Txtcodekubun" runat= "Server" imemode= "Disabled" width= "30px" tabindex= "1"                     onfocus= "Ongreen (' Txtcodekubun ')"           &NBSP ;         onkeyup= "Txtchange (This,document.getelementbyid (' Cmbcodekubun '))"                     onblur= "Txtchangeblur (This,document.getelementbyid (' Cmbcodekubun ')")                     onchange= "Showcomment (This,document.getelementbyid (' lblcomment '),                              &N Bsp                document.getelementbyid (' txtcomment '),                                 ,         &NB Sp     ' 013 ', ' 185px ', ' 400px ', '*comment:how is you! ') "                     maxlength= "3" lengthasbytes= "true" >                </aspx:Textbox>

ASP. Javascript Operations TextBox Property Application ()

Related Article

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.