Disabled Edit Box Colour

C

Craig

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 ?
 
F

Fabian

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.
 
C

Craig

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
 
F

Frank Carr

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.
 
G

Grant Wagner

Frank said:
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 <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_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-developer/upgrade_2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top