Solved

Protect the label

Posted on 2014-07-23
7
155 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 80

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
How our DevOps Teams Maximize Uptime

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

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
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…

685 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