Re: [PHP] Quarters -- ERRORS --

2008-04-14 Thread Peter Ford

tedd wrote:

Hi gang:

Sorry for the lame app, but the program worked for Safari (Mac and Win). 
However, I did get it to work for FF and a couple of other browsers (Mac 
and Win), see again:


http://webbytedd.com/quarters

But the critter is dead in the water for all versions of IE -- if -- I 
don't figure out a way around the following single statement.


document.getElementById(id).checked = true;

Granted it's javascript, but all that line does is to set a checkbox 
variable (id) to 'on'. Surely, $M code can do that, right?


After reading a bunch, it seems that M$ has a better way to do things 
(big surprise there, huh?) and thus does not use the 
document.getElementById(id) thing that everyone else in the world uses. 
Instead, they use something better and it's not documented well as is 
typical.


Unfortunately, I have not been able to find a M$ work-a-round.

So, what I need is:

if (document.getElementById)
   {
   document.getElementById(id).checked = true;
   }
else
   {
inset solution here. 
   }

All the code has to do is to set a simple checkbox to 'on' in IE.

Anyone have any ideas?

Cheers,

tedd

PS: I'm going to post this on a js list as well.

PPS: You have to wonder how much more technically advanced we would be 
if we weren't always held back by the what's in it for me 
shortsightedness of M$.





What you talkin' bout?
Document.getElementById() works fine in IE5 and later.
There must be some other error.

You could check that document.getElementById(id) is actually returning something 
- if it fails it returns null.


Maybe you have given your checkbox a name and not an id, although that should 
fail with FF (and Safari) too...


It's fine on IE7 - anything older than IE7 is too broken to be usable, really. 
:)



--
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quarters -- ERRORS --

2008-04-14 Thread tedd

What you talkin' bout?
Document.getElementById() works fine in IE5 and later.
There must be some other error.


The error was that I was passing the id as an array and not as a string.

What's interesting is that only IE's would not accept that mistake.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Quarters -- ERRORS --

2008-04-11 Thread tedd

Hi gang:

Sorry for the lame app, but the program worked for Safari (Mac and 
Win). However, I did get it to work for FF and a couple of other 
browsers (Mac and Win), see again:


http://webbytedd.com/quarters

But the critter is dead in the water for all versions of IE -- if -- 
I don't figure out a way around the following single statement.


document.getElementById(id).checked = true;

Granted it's javascript, but all that line does is to set a checkbox 
variable (id) to 'on'. Surely, $M code can do that, right?


After reading a bunch, it seems that M$ has a better way to do things 
(big surprise there, huh?) and thus does not use the 
document.getElementById(id) thing that everyone else in the world 
uses. Instead, they use something better and it's not documented 
well as is typical.


Unfortunately, I have not been able to find a M$ work-a-round.

So, what I need is:

if (document.getElementById)
   {
   document.getElementById(id).checked = true;
   }
else
   {
inset solution here. 
   }

All the code has to do is to set a simple checkbox to 'on' in IE.

Anyone have any ideas?

Cheers,

tedd

PS: I'm going to post this on a js list as well.

PPS: You have to wonder how much more technically advanced we would 
be if we weren't always held back by the what's in it for me 
shortsightedness of M$.



--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

Re: [PHP] Quarters -- ERRORS --

2008-04-11 Thread Kirk . Johnson
tedd [EMAIL PROTECTED] wrote on 04/11/2008 02:49:21 PM:

 But the critter is dead in the water for all versions of IE -- if -- 
 I don't figure out a way around the following single statement.
 
 document.getElementById(id).checked = true;
 
 After reading a bunch, it seems that M$ has a better way to do things 
 (big surprise there, huh?) and thus does not use the 
 document.getElementById(id) thing that everyone else in the world 
 uses. Instead, they use something better and it's not documented 
 well as is typical.
 
 So, what I need is:
 
 if (document.getElementById)
 {
 document.getElementById(id).checked = true;
 }
 else
 {
  inset solution here. 
 }

The Javascript code below, using either Method 1 or Method 2, works fine 
in IE 7. Have you tried running it in Firefox with the error console open? 
I am wondering if there isn't a minor syntax error somewhere.

Kirk

htmlheadtitle/title

script type=text/javascript
function checkme() {

// Method 1 - works fine in IE 7
//  if(document.forms[0].test.checked) {
//document.forms[0].test.checked = false;
//  }
//  else {
//document.forms[0].test.checked = true; // }
//  }

// Method 2 - works fine in IE 7
if(document.getElementById('test').checked) {
  document.getElementById('test').checked = false;
} else {
  document.getElementById('test').checked = true;
}
}
/script
/head
body

form action= method=post
input type=checkbox name=test id=test onmouseover=checkme(); 
Mouse Me
/form

/body/head/html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quarters -- ERRORS --

2008-04-11 Thread Nathan Nobbe
On Fri, Apr 11, 2008 at 4:49 PM, tedd [EMAIL PROTECTED] wrote:

 Hi gang:

 Sorry for the lame app, but the program worked for Safari (Mac and Win).
 However, I did get it to work for FF and a couple of other browsers (Mac and
 Win), see again:

 http://webbytedd.com/quarters

 But the critter is dead in the water for all versions of IE -- if -- I
 don't figure out a way around the following single statement.

 document.getElementById(id).checked = true;

 Granted it's javascript, but all that line does is to set a checkbox
 variable (id) to 'on'. Surely, $M code can do that, right?

 After reading a bunch, it seems that M$ has a better way to do things (big
 surprise there, huh?) and thus does not use the document.getElementById(id)
 thing that everyone else in the world uses. Instead, they use something
 better and it's not documented well as is typical.

 Unfortunately, I have not been able to find a M$ work-a-round.

 So, what I need is:

 if (document.getElementById)
   {
   document.getElementById(id).checked = true;
   }
 else
   {
inset solution here. 
   }

 All the code has to do is to set a simple checkbox to 'on' in IE.


hmm.  looking at the prototype.js lib, which has the $() function to replace
document.getElementById().  it supports either a dom object or a string that
represents an id attribute, but key note is its 'cross-browser' and i dont
see a workaround in there for ms..

function $(element) {
  if (arguments.length  1) {
for (var i = 0, elements = [], length = arguments.length; i  length;
i++)
  elements.push($(arguments[i]));
return elements;
  }
  if (Object.isString(element))
element = document.getElementById(element);
  return Element.extend(element);
}

ie has some primitive debugging tools, have you checked one of those to see
if theres an error on the page?  if you choke the js interpreter w/ a fatal
error you might kill all subsequent js interpretation on the page :O  ie has
been the bane of my existence on more than one occasion.

-nathan