Solved

Protect the label

Posted on 2014-07-23
7
153 Views
Last Modified: 2014-07-24
Hi,
what is the way to protect the label below?

<input type="label" id="lb_p1" style="height:14px; width:92px; font-size:x-small; border:none; background-color:#1BA8E0" value="desc1" runat="server" /><br/>

Open in new window

0
Comment
Question by:HuaMinChen
7 Comments
 
LVL 7

Expert Comment

by:cstsang
ID: 40213774
What do you mean "protect"?
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40213781
Make it non-editable.
0
 
LVL 79

Expert Comment

by:David Johnson, CD, MVP
ID: 40213828
Labels are not editable by default unlike a textbox that is editable, so I don't understand your question
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40215029
Just add disabled to the attributes. and it will not accept input.

Cd&
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40215860
COBOL,
how to add "disabled"?
0
 
LVL 11

Accepted Solution

by:
azarc3 earned 190 total points
ID: 40216806
I'm not 100% certain what you're trying to accomplish.... but Labels aren't editable. As far as I can tell what you have isn't valid HTML as there is no input type="label" that I can find.

More than likely it's editable because you've got the input tag.

I think you meant to do the following:
<label id="lb_p1" style="height:14px; width:92px; font-size:x-small; border:none; background-color:#1BA8E0">desc1</label><br/>

Open in new window

Finally, Labels are container tags and should have both the opening <label> and the closing </label>. You can read more about it here.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40217066
Yeah label is not valid but that just means the browser will default to text. As fo adding disabled you just put it in the tag with the rest of the attributes.  No offense intended, but is this your first attempt at HTML?

Cd&
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question