Solved

Protect the label

Posted on 2014-07-23
7
151 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
Comment Utility
What do you mean "protect"?
0
 
LVL 10

Author Comment

by:HuaMinChen
Comment Utility
Make it non-editable.
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
Comment Utility
Labels are not editable by default unlike a textbox that is editable, so I don't understand your question
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 53

Expert Comment

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

Cd&
0
 
LVL 10

Author Comment

by:HuaMinChen
Comment Utility
COBOL,
how to add "disabled"?
0
 
LVL 11

Accepted Solution

by:
azarc3 earned 190 total points
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now