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

grid javascript

P: n/a
Hi,

any excel like grid javascript which is stable and fast to load thousand of rows data ? can it have F2 function to popup another window ? can validate cell value when cursor move away that cell ?

Either free or low developer license with royalty-free distributed with web application.

TQ.
Regards
Hoe
tn***@pc.jaring.my
Jul 23 '05 #1
Share this Question
Share on Google+
19 Replies


P: n/a
i'm working on it, ready in 2 months

Jul 23 '05 #2

P: n/a
"michael elias"

well, plz drop me more details when you are ready.

TQ
hoe
Jul 23 '05 #3

P: n/a
Really? That would be neat.

After seeing your response I wondered if you're the one to ask this: where
can I find a JavaScript to put commas in a number as it's type into an HTML
textbox? I searched the web for such a script and I find a bunch that work
(I guess) if you want the user to enter the value, then click a button to
format the entry. But that's a lame user interface. I need this to happen
as they type. I tried to modify a few, but I'm still new to JavaScript, so
I didn't have much success. Do you know of such a script?

Thanks,

Russell Campbell

"michael elias" <mi************@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
i'm working on it, ready in 2 months

Jul 23 '05 #4

P: n/a
"Russell Campbell" <no****@byteme.com> wrote in message
news:wN****************@newsread3.news.atl.earthli nk.net...
Really? That would be neat.

After seeing your response I wondered if you're the one to ask this: where can I find a JavaScript to put commas in a number as it's type into an HTML textbox? I searched the web for such a script and I find a bunch that work (I guess) if you want the user to enter the value, then click a button to
format the entry. But that's a lame user interface. I need this to happen as they type. I tried to modify a few, but I'm still new to JavaScript, so I didn't have much success. Do you know of such a script?

Thanks,

Russell Campbell

Will this help?

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length == 0) return;
for (i=0; i<what.length; i++) {
if (i > 0 && i % 3 == 0) temp += ",";
temp += what.charAt(i);
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>

Of course, JavaScript has to be enabled.
Jul 23 '05 #5

P: n/a
Yes, that does it for integers. Thanks. I did notice that if you enter
123456789.00 then you get 123,456,789,.00

However, in this case the user will only be entering positive integer
values, so I'm not too concerned about that issue (though if you wanted to
submit a corrected script, I would not object <g>).

Thanks again - especially for the quick reply!

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:8-********************@comcast.com...
"Russell Campbell" <no****@byteme.com> wrote in message
news:wN****************@newsread3.news.atl.earthli nk.net...
Really? That would be neat.

After seeing your response I wondered if you're the one to ask this:

where
can I find a JavaScript to put commas in a number as it's type into an

HTML
textbox? I searched the web for such a script and I find a bunch that

work
(I guess) if you want the user to enter the value, then click a button to
format the entry. But that's a lame user interface. I need this to

happen
as they type. I tried to modify a few, but I'm still new to JavaScript,

so
I didn't have much success. Do you know of such a script?

Thanks,

Russell Campbell

Will this help?

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length == 0) return;
for (i=0; i<what.length; i++) {
if (i > 0 && i % 3 == 0) temp += ",";
temp += what.charAt(i);
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>

Of course, JavaScript has to be enabled.

Jul 23 '05 #6

P: n/a
Whoops - I was not careful enough in looking at this (I was happy just to
get a script that woked as the user typed). This adds the comma from left
to right, so if you enter 12345 - you get 123,45. I think using the
function function that will reverse text, then having it add the commas,
then reversing it back might fix the issue . . .

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:8-********************@comcast.com...
"Russell Campbell" <no****@byteme.com> wrote in message
news:wN****************@newsread3.news.atl.earthli nk.net...
Really? That would be neat.

After seeing your response I wondered if you're the one to ask this:

where
can I find a JavaScript to put commas in a number as it's type into an

HTML
textbox? I searched the web for such a script and I find a bunch that

work
(I guess) if you want the user to enter the value, then click a button to
format the entry. But that's a lame user interface. I need this to

happen
as they type. I tried to modify a few, but I'm still new to JavaScript,

so
I didn't have much success. Do you know of such a script?

Thanks,

Russell Campbell

Will this help?

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length == 0) return;
for (i=0; i<what.length; i++) {
if (i > 0 && i % 3 == 0) temp += ",";
temp += what.charAt(i);
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>

Of course, JavaScript has to be enabled.

Jul 23 '05 #7

P: n/a
"Russell Campbell" <no****@byteme.com> wrote in message
news:F1****************@newsread3.news.atl.earthli nk.net...
Whoops - I was not careful enough in looking at this (I was happy just to
get a script that woked as the user typed). This adds the comma from left
to right, so if you enter 12345 - you get 123,45. I think using the
function function that will reverse text, then having it add the commas,
then reversing it back might fix the issue . . .


[snip]

Very poor quality control on my part -- sorry.

Try this though I may refine it:

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var j = 0;
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length < 4) return;
for (i=what.length; i>-1; i--) {
temp = what.charAt(i) + temp;
if (i > 0 && j == 3) {
temp = "," + temp;
j = 0;
}
j++;
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>
Jul 23 '05 #8

P: n/a
That works great for the commas. Thanks. It still has the problem with a
decimal place, but that's of no concern to me in this particular situation.
Try entering 123456.00 and you'll see what I'm talking about.

But it's always something, isn't it? I noticed that this seems to kill the
"select on entry" feature of the textbox. You know, where you tab to the
textbox and its contents are highlighted so that the first thing you type
replaces the highlighted text. The textboxes without this script still work
that way, but for the ones with the script the text highlights briefly and
then immediately goes away. This does not prevent the script from working,
but forces the user to stop and manually highlight the text. Kind of
strange . . . you wouldn't think a script associated with onKeyUp would
exhibit such behavior.

Thanks for the help! I must say I'm none too fond of JavaScript. Too
cryptic for my taste and the case sensitivity drives me batty. There's no
point in it. But, of course, it can help you accomplish some nifty things
in a browser.

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ye********************@comcast.com...
"Russell Campbell" <no****@byteme.com> wrote in message
news:F1****************@newsread3.news.atl.earthli nk.net...
Whoops - I was not careful enough in looking at this (I was happy just to
get a script that woked as the user typed). This adds the comma from
left
to right, so if you enter 12345 - you get 123,45. I think using the
function function that will reverse text, then having it add the commas,
then reversing it back might fix the issue . . .


[snip]

Very poor quality control on my part -- sorry.

Try this though I may refine it:

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var j = 0;
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length < 4) return;
for (i=what.length; i>-1; i--) {
temp = what.charAt(i) + temp;
if (i > 0 && j == 3) {
temp = "," + temp;
j = 0;
}
j++;
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>

Jul 23 '05 #9

P: n/a
Just another bit of info. To highlight the text, I noticed CTRL-A
highlights it for a moment then it clears. A triple-click works and and
Shift-End works (if done immediately after entering the field). I'm
wondering if the script should check for a key code representing a number
and ignore anything that's not a number.

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ye********************@comcast.com...
"Russell Campbell" <no****@byteme.com> wrote in message
news:F1****************@newsread3.news.atl.earthli nk.net...
Whoops - I was not careful enough in looking at this (I was happy just to
get a script that woked as the user typed). This adds the comma from
left
to right, so if you enter 12345 - you get 123,45. I think using the
function function that will reverse text, then having it add the commas,
then reversing it back might fix the issue . . .


[snip]

Very poor quality control on my part -- sorry.

Try this though I may refine it:

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var j = 0;
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length < 4) return;
for (i=what.length; i>-1; i--) {
temp = what.charAt(i) + temp;
if (i > 0 && j == 3) {
temp = "," + temp;
j = 0;
}
j++;
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>

Jul 23 '05 #10

P: n/a
Yep, a change to ignore anything but numbers helped me out. My version:

function FormatNumberWithCommas(toTextbox)
{
if (event.keyCode >= 96 && event.keyCode <= 105)
{
var j = 0;
var temp = "";
var what = toTextbox.value.replace(/,/g,"");
if (what.length < 4) return;
for (i=what.length; i>-1; i--)
{
temp = what.charAt(i) + temp;
if (i > 0 && j == 3)
{
temp = "," + temp;
j = 0;
}
j++;
}
toTextbox.value = temp;
}
}
Thanks for all your help. I really appreciate it.

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ye********************@comcast.com...
"Russell Campbell" <no****@byteme.com> wrote in message
news:F1****************@newsread3.news.atl.earthli nk.net...
Whoops - I was not careful enough in looking at this (I was happy just to
get a script that woked as the user typed). This adds the comma from
left
to right, so if you enter 12345 - you get 123,45. I think using the
function function that will reverse text, then having it add the commas,
then reversing it back might fix the issue . . .


[snip]

Very poor quality control on my part -- sorry.

Try this though I may refine it:

<html>
<head>
<title>commas.htm</title>
<script type="text/javascript">
function commas(that) {
var j = 0;
var temp = "";
var what = that.value.replace(/,/g,"");
if (what.length < 4) return;
for (i=what.length; i>-1; i--) {
temp = what.charAt(i) + temp;
if (i > 0 && j == 3) {
temp = "," + temp;
j = 0;
}
j++;
}
that.value = temp;
}
</script>
</head>
<body>
<form>
<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this)">
<input type="reset" value="Clear">
</form>
</body>
</html>

Jul 23 '05 #11

P: n/a
Russell Campbell wrote:
Yep, a change to ignore anything but numbers helped me out. My version:

function FormatNumberWithCommas(toTextbox)
{
if (event.keyCode >= 96 && event.keyCode <= 105)
{
var j = 0;
var temp = "";
var what = toTextbox.value.replace(/,/g,"");
if (what.length < 4) return;
for (i=what.length; i>-1; i--)
{
temp = what.charAt(i) + temp;
if (i > 0 && j == 3)
{
temp = "," + temp;
j = 0;
}
j++;
}
toTextbox.value = temp;
}
}


Or to harness RegExp and not sniff keycodes you could try:

function FormatNumberWithCommas(t) {
var n = t.value.replace(/\D/g,'').split('');
var j = n.length;
var z = n[0];
if ( j < 4 ) return;
while (--j) {
( j%3 )? z += ',' + n[j] : z += n[j];
}
t.value = z;
}
Simply removes any non-digit input and works in IE & Firefox.
One further optimisation would be to remove leading zeros by
modifying the RegExp.

Not completely reliable, but OK for some uses I guess.
--
Rob
Jul 23 '05 #12

P: n/a
RobG wrote:
[...]

Or to harness RegExp and not sniff keycodes you could try:

function FormatNumberWithCommas(t) {
var n = t.value.replace(/\D/g,'').split('');
var j = n.length;
var z = n[0];
if ( j < 4 ) return;
while (--j) {
( j%3 )? z += ',' + n[j] : z += n[j];
}
t.value = z;
}


Ugghh, sorry, meant to save that as draft, didn't realise I'd
posted it. Anyway, here is the corrected script (also tested in
Safari now too):
function FormatNumberWithCommas(t) {
var n = t.value.replace(/\D/g,'').split('');
var j = n.length;
if ( j < 4 ) {t.value = n.join(''); return;}
var i = 0;
t.value = n[0];
while (--j) {
( j%3 == 0 )? t.value += ','+n[++i] : t.value += n[++i];
}
}
--
Rob
Jul 23 '05 #13

P: n/a
Russell Campbell wrote:
I got another version of the function that handles decimals before you submitted this one (see other responses), so I switched to that one.
However, I notice now that it (and perhaps yours) does not handle
backspacing properly. For instance, if I enter 11002, I get 11,002 - however if I backspace, I end up with 11,00

It's getting harder for me to follow the version I'm using due to the heavy use of regular expressions, so I'm not sure how to handle the backspace issue . . .

Thanks for your continued input.

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:V8********************@comcast.com...
"Russell Campbell" <no****@byteme.com> wrote in message
news:xt*****************@newsread2.news.atl.earthl ink.net...
That works great for the commas. Thanks. It still has the problem with a
decimal place, but that's of no concern to me in this particular

situation.
Try entering 123456.00 and you'll see what I'm talking about.


Just add the following as the function's first line:

if (that.value.indexOf(".") >= 0) return;


Let them eat commas. #:~o

That 'slamming caret' always seems to be an issue. Caret control is
problemmatic cross-browser so it's probably a matter of how much users
will (or should) tolerate.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>untitled</title>
<style type="text/css">

input {
display: block;
width: 70%;
padding: 3px;
margin: 222px auto;
font: bold 24px monospace;
text-align: center;
border: 3px #fff inset;
background: ghostwhite;
}

</style>
<script type="text/javascript">

//---------------------------------------------//
String.prototype.reverse = function()
{
return this.split('').reverse().join('');
}
String.prototype.addCommas = function()
{
var temp = this.reverse();
temp = temp.replace(/(\d{3})(?=\d)/g, '$1,');
return temp.reverse();
}
//---------------------------------------------//

function filter(str)
{
return str.replace(/(^0+|\D)/g, '');
}

function format(ipt)
{
if (ipt.value.length != ipt.prev_value.length)
{
var m, re = /\.(.*)$/, cents = '';
if (m = ipt.value.match(re))
{
cents += '.'
if (!/^$/.test(m[1]))
cents += m[1].replace(/\D/g, '').substring(0, 2);
ipt.value = ipt.value.replace(re, '');
}
ipt.value = filter(ipt.value).addCommas() + cents;
}
}

function addZeros(ipt)
{
if (/\.\d*$/.test(ipt.value))
ipt.value += '00';
else ipt.value += '.00';
ipt.value = ipt.value.replace(/(\.\d{2}).+$/, '$1');
}

window.onload = function()
{
with (document.forms[0].elements[0])
{
value = '';
focus();
}
}

</script>
</head>
<body>
<form>
<input type="text" value=""
onkeydown="this.prev_value=this.value"
onkeyup="format(this)"
onblur="addZeros(this)" />
</form>
</body>
</html>

Jul 23 '05 #14

P: n/a
You could look at it that way or someone could look at your idea and say
that you're willing to take the poor interface that is the Internet and not
try to improve it . . .
"Dr John Stockton" <sp**@merlyn.demon.co.uk> wrote in message
news:4M**************@merlyn.demon.co.uk...
JRS: In article <8-********************@comcast.com>, dated Tue, 15 Mar
2005 15:29:38, seen in news:comp.lang.javascript, McKirahan
<Ne**@McKirahan.com> posted :


Will this help?


If one types 123456789 and has 123,456,789 your code does not allow one
to cursor-left and delete the 5.

Meddling with the user interface is a bad idea.

If the user wants to see commas, let him type them.
If the application needs commas, let it add them to the number once
completed.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00
MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links,
acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see
00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm
etc.

Jul 23 '05 #15

P: n/a
Russell Campbell wrote:
Thanks. It's good to handle decimals, of course, but this version has the
same problem as the original script. When the user tabs to the field it
immediately highlights all text, then immediately removes the highlighting.
In IE, yes. In Firefox, no.

You can stop IE deselecting the text by using onkeypress, but
then the comma fixing routine doesn't fix the number after
the currently entered digit so you have 4 digits after the
right-most comma.
This causes the user to have to stop and manually select all the text (with
the previously mentioned limitations on that action) and then type in the
Not really. This method simply looks at the entered text, it
doesn't use keycode checking, so ctrl+a works fine. I think if
you head down the path of trying to reinvent the entire
interface by parsing input keystroke by keystroke you are almost
certain to end up with a dysfunctional interface.

You could try to detect a tab onkeyup, which should mean that
the user has just entered the cell (but is likely unreliable),
then select all the text...
number. My version - just a slight mod to McKirahan's version - solves this
problem and lets the "select on entry" feature work as the user expects.
Perhaps there's another way to solve the problem, but this one does work.


Depends on your definition of 'works'. The keycodes you have
used are for the numeric keypad, not the main key set above the
qwerty keys. Many laptops and smaller keyboards do not have
numeric pads so the range should extend to include keycodes 48
to 57 inclusive - hence my attempt to remove them from the
algorithm - or tell users which keys they must use.

Secondly, your script will not work in Firefox (or similar
browsers). You must pass 'event' to the function:

<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this,event)">

and then capture it in the function:

function FormatNumberWithCommas(toTextbox,event){
if (event.keyCode ...

As others have said, I think the best way to handle input is to
allow the user to enter whatever they want, then validate when
they are finished. There should be clear instructions next to
any special fields to indicate the format required.
--
Rob
Jul 23 '05 #16

P: n/a
Thanks. However the users have specifically asked for comma formatting as
they type and I am trying to accommodate them. It's always nice to be
cross-platform compatible, however the reality of my situation is that most
users, if not all, will be on IE. I think you missed the point on one
issue - the script causes the text to "unhighlight" upon entry. CTRL-A does
not work when attempting to rehighlight it - I'm not sure why you'd see
anything different if you're using IE. But regardless of what works to
rehighlight it, that's just something that will slow down the user and tend
to be annoying. The point is I don't want them to have to rehighlight it.
There are improvements that can be made (hey I got this for free from other
responders in this thread - I can't expect them to spend their entire life
on this), but if I can get it "good enough" and the users like it, then
who's to say they are wrong?

"RobG" <rg***@iinet.net.auau> wrote in message
news:wI****************@news.optus.net.au...
Russell Campbell wrote:
Thanks. It's good to handle decimals, of course, but this version has
the same problem as the original script. When the user tabs to the field
it immediately highlights all text, then immediately removes the
highlighting.


In IE, yes. In Firefox, no.

You can stop IE deselecting the text by using onkeypress, but
then the comma fixing routine doesn't fix the number after
the currently entered digit so you have 4 digits after the
right-most comma.
This causes the user to have to stop and manually select all the text
(with the previously mentioned limitations on that action) and then type
in the


Not really. This method simply looks at the entered text, it
doesn't use keycode checking, so ctrl+a works fine. I think if
you head down the path of trying to reinvent the entire
interface by parsing input keystroke by keystroke you are almost
certain to end up with a dysfunctional interface.

You could try to detect a tab onkeyup, which should mean that
the user has just entered the cell (but is likely unreliable),
then select all the text...
number. My version - just a slight mod to McKirahan's version - solves
this problem and lets the "select on entry" feature work as the user
expects. Perhaps there's another way to solve the problem, but this one
does work.


Depends on your definition of 'works'. The keycodes you have
used are for the numeric keypad, not the main key set above the
qwerty keys. Many laptops and smaller keyboards do not have
numeric pads so the range should extend to include keycodes 48
to 57 inclusive - hence my attempt to remove them from the
algorithm - or tell users which keys they must use.

Secondly, your script will not work in Firefox (or similar
browsers). You must pass 'event' to the function:

<input type="text" name="numb"
style="text-align:right"
onkeyup="commas(this,event)">

and then capture it in the function:

function FormatNumberWithCommas(toTextbox,event){
if (event.keyCode ...

As others have said, I think the best way to handle input is to
allow the user to enter whatever they want, then validate when
they are finished. There should be clear instructions next to
any special fields to indicate the format required.
--
Rob

Jul 23 '05 #17

P: n/a
rh
Csaba Gabor wrote:

<..>
Here's a shorter version:

function FormatNumberWithCommas(t) {
t.value = t.value.replace(/[^\d]/g,'').replace(
/(\d)(\d\d)(?=\d(\d\d\d)*$)/g,"$1,$2");
}
However, neither of the above versions accounts for decimals.
To allow for decimals, I expanded FormatNumberWithCommas as below:
<html><head><title>commas.htm</title>
<script type="text/javascript">
String.prototype.rvrs = function() {
var rv=""; for (var i=this.length;i--;) rv+=this.charAt(i);return rv;} function FormatNumberWithCommas(t) {
var n = t.value.replace(/[^\d.]/g,'');
if (n.indexOf(".")<0) return t.value =
n.replace(/(\d)(\d\d)(?=\d(\d\d\d)*$)/g,"$1,$2");
// this part is for decimal points
var regx=/(\d)(\d\d)(?=\d(\d\d\d)*\.)/g;
return t.value =
n.rvrs().replace(regx,"$1,$2").rvrs().replace(regx ,"$1,$2");
}
</script></head>


That seems to be a bit more complex than necessary. The following
should do as well, I believe:

String.prototype.sepFmt = Number.prototype.sepFmt =
function () {
var n = +this;
if (isNaN(n=""+n)) return "";
while ( /^[^.]*\d{4}/.test(n) )
n=n.replace(/^([^.]*\d)(\d{3})/,"$1,$2") ;
return n;
}

../rh

Jul 23 '05 #18

P: n/a
Russell Campbell wrote:
Thanks. However the users have specifically asked for comma formatting as
they type and I am trying to accommodate them. It's always nice to be
cross-platform compatible, however the reality of my situation is that most
users, if not all, will be on IE.
All that is required for your script to support non-IE browsers
is the addition of the word 'event' to the call and function.
It does not affect the script's suitability for IE in any way.

A browser-specific solution - particularly in a corporate
environment - does not make any sense from a cost/benefit (i.e.
vendor lock-in) perspective. The effort to include two words in
a script compared to the cost of finding and detecting the
incompatibility later should an alternative browser be chosen is
trivial. The more IE-only functionality that is implemented, the
bigger the issue becomes (which, some would say, is why MS is so
aggressive at pushing Microsoft proprietary features ahead of
standards compliance).

It is inconceivable that such a decision would be allowed where
I work (which uses IE as a component of its Windows-based
corporate desktop on 4,500 PCs).

Fortunately, alternative browsers are tolerated, which actually
provides a greater benefit by detecting and fixing errors missed
by 'testers' using IE than the pain associated with occasional
cross-browser hiccups.
issue - the script causes the text to "unhighlight" upon entry. CTRL-A does
not work when attempting to rehighlight it - I'm not sure why you'd see
anything different if you're using IE. But regardless of what works to
I use a variety of browsers, but IE when I have to - which is
only ever because sites have been written to only support IE.
rehighlight it, that's just something that will slow down the user and tend
to be annoying. The point is I don't want them to have to rehighlight it.
There are improvements that can be made (hey I got this for free from other
responders in this thread - I can't expect them to spend their entire life
on this), but if I can get it "good enough" and the users like it, then
who's to say they are wrong?


Whatever makes them happy. At least include the keyCode range
for the main numeric keys so that they can be used too.

--
Rob
Jul 23 '05 #19

P: n/a
> All that is required for your script to support non-IE browsers
is the addition of the word 'event' to the call and function.
It does not affect the script's suitability for IE in any way.
Well, I probably will do that, though I'm a little unclear on this. In the
script, I refer to it as "event". You're saying I can pass it to the
function by putting "event" in the onKeyUp (just like I pass the reference
to the textbox with "this"). But if I can refer to it as "event" in the
onKeyUp statement, why can't I refer to it as "event" in the script
(obviously I can for IE, but why not for other browsers)?
A browser-specific solution - particularly in a corporate
environment - does not make any sense from a cost/benefit (i.e.
vendor lock-in) perspective. The effort to include two words in
a script compared to the cost of finding and detecting the
incompatibility later should an alternative browser be chosen is
trivial.
I never said it wasn't worth it to me to make reasonable changes to make it
cross-platform.
The more IE-only functionality that is implemented, the
bigger the issue becomes (which, some would say, is why MS is so
aggressive at pushing Microsoft proprietary features ahead of
standards compliance).
I whole-heartedly agree - FrontPage, which I use, is always putting in
FrontPage extensions via webbots and whatnot and I just get rid of them.
Whatever makes them happy. At least include the keyCode range
for the main numeric keys so that they can be used too.


I'd already done that. I shouldn't have fogotten that, but I did.

Thanks for all your input.
Jul 23 '05 #20

This discussion thread is closed

Replies have been disabled for this discussion.