469,915 Members | 2,652 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,915 developers. It's quick & easy.

Disabled Edit Box Colour

I have a page that has a few columns and totals.

I've been asked to amke sure that not only is the totals boxes readonly,
they must not accept focus from the cursor.

However, setting the bo to Disabled makes the font go inverted it seems. I'd
like to be able to still control the colour of these boxes, both the
background and foreground, but not makethem the light grey that they are
going at the moment.

Is there a way to make sure the user can't tab to a totals edit box ?
Jul 20 '05 #1
4 3016
Craig hu kiteb:
I have a page that has a few columns and totals.

I've been asked to amke sure that not only is the totals boxes
readonly, they must not accept focus from the cursor.

However, setting the bo to Disabled makes the font go inverted it
seems. I'd like to be able to still control the colour of these
boxes, both the background and foreground, but not makethem the light
grey that they are going at the moment.

Is there a way to make sure the user can't tab to a totals edit box ?


Set an onfocus event on that box to transfer the focus. Then you don't
need to explicitly disable it.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #2
Thanks for that!

I'm just knocked with another problem here...
Now when the focus gets moved to the next available enabled edit box, the
text isn't selected when you use editbox.setfocus.

However, when you tab normally to edit boxes, the text is selected.

Anyway to get around this small thing ?

Craig

"Fabian" <la****@hotmail.com> wrote in message
news:bq*************@ID-174912.news.uni-berlin.de...
Craig hu kiteb:
I have a page that has a few columns and totals.

I've been asked to amke sure that not only is the totals boxes
readonly, they must not accept focus from the cursor.

However, setting the bo to Disabled makes the font go inverted it
seems. I'd like to be able to still control the colour of these
boxes, both the background and foreground, but not makethem the light
grey that they are going at the moment.

Is there a way to make sure the user can't tab to a totals edit box ?


Set an onfocus event on that box to transfer the focus. Then you don't
need to explicitly disable it.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #3
"Craig" <my****@myaccount.com> wrote in message
news:3f***********************@lovejoy.zen.co.uk.. .
I have a page that has a few columns and totals.

I've been asked to amke sure that not only is the totals boxes readonly,
they must not accept focus from the cursor.

..........

Is there a way to make sure the user can't tab to a totals edit box ?


My recommendation would be not to use an edit box to display the totals. If
it is a edit box it gives a 'visual affordance' of being clickable,
tab-able, and editable. Use a different method to display the total so that
the user can easily tell that it isn't for interaction.
--
Frank Carr
jf****@msn.com
http://www15.brinkster.com/vbnotebook
Jul 20 '05 #4
Frank Carr wrote:
"Craig" <my****@myaccount.com> wrote in message
news:3f***********************@lovejoy.zen.co.uk.. .
I have a page that has a few columns and totals.

I've been asked to amke sure that not only is the totals boxes readonly,
they must not accept focus from the cursor.

..........

Is there a way to make sure the user can't tab to a totals edit box ?


My recommendation would be not to use an edit box to display the totals. If
it is a edit box it gives a 'visual affordance' of being clickable,
tab-able, and editable. Use a different method to display the total so that
the user can easily tell that it isn't for interaction.


Why not something like:

<form>
<input type="text" name="one" size="5"
onblur="this.form.result.value = +this.value + +this.form.two.value;" />
<input type="text" name="two" size="5"
onblur="this.form.result.value = +this.value + +this.form.one.value;" />
=
<input type="text" name="result" size="5" readonly onfocus="this.blur();"
style="border:none;border-bottom:1px solid Black;text-align:right;" />
</form>

Works in every browser from Netscape 4 (and possibly 3) to the most modern
browsers available. Certainly it creates some false input cues on some
browsers, but it provides the same functionality on almost every browser
without any modification what-so-ever.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bryan Van. | last post: by
reply views Thread by Andy Bates | last post: by
2 posts views Thread by Carl Gilbert | last post: by
4 posts views Thread by Bob | last post: by
2 posts views Thread by =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= | last post: by
16 posts views Thread by shapper | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.