By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,481 Members | 1,713 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,481 IT Pros & Developers. It's quick & easy.

Disabled Edit Box Colour

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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.