473,465 Members | 4,823 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Making button's borderColor equal to linkColor


I want the border color of this button to be the same as
document.linkColor. How can I implement this?

My best solution has been to have the onload handler for the page
find the button and set its style.borderColor attribute to the
desired color. Is there a better way?

Many thanks in advance,

Karl

--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.
Jul 23 '05 #1
1 1322
> My best solution has been to have the onload handler for the page
find the button and set its style.borderColor attribute to the
desired color. Is there a better way?


You can set buttons to use a css class say <input type=button
class=lcButton...

You can then dynamically change the style specified in javascript
onload of the document. I don't have the exact syntax for changing the
css style in front of me but I have seen others do it and I've done it
sometime in the past.

If you have many buttons on the page, this method would theoretically
be more efficient since you don't have to find all the buttons in the
DOM

Another method would be to detect the document.linkColor at the top of
the body (just after body tag) and use document.writes for your
buttons forcing in the inline style at that time. Not sure if
document.linkColor is initialized at that point though.

JsD
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Michael Albanese | last post by:
I recently read an article that mentioned adding code to the onload event to "register a default button". The behavior i am after is that when the user hits enter, the form submits. Does...
3
by: windandwaves | last post by:
Hi, I am trying to make errors a bit more meaningful for my users. I am trying to fix error 3201 where there is a missing field in a form. If I do not do any error trapping, then I get ...
1
by: yamne | last post by:
I have a problem. When I click in edit datagrid button I show two listbox and two button. I use two button to move data between two listbox. My problem is that I can't call the listbox in the...
2
by: Michael | last post by:
Need some help trying to read values from web controls - specifically *finding* the controls (like a drop down list) - that are added dynamically added within an asp:panel control. The page...
1
by: Luis Esteban Valencia | last post by:
I have a datalist. This is the code. I have 2linkbuttons and it depends of a field to show one or the other. The IF clause is OK, but its showing me the links in BLACK not in blue! and they are...
8
by: pmud | last post by:
Hi, I have 2 questions: 1. I have an editable data grid with 21 columns. I need to edit only 2 cloumns in this data grid. But when the grid is displayed in Edit mode, all the columns show long...
2
by: Jeff S | last post by:
Hello I am having an issue with changing the bordercolor of the panel control I have got to a point where I have created my own control and inherited the Panel control, then in the Overrides Sub...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
3
by: rn5a | last post by:
How do I change the BorderColor of the rows under the 2nd column in a DetailsView? I could change the BorderColor of the 1st column using the FieldHeaderStyle-BorderColor property but using...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.