|
|
 |
Re: FN-FORUM: Check box problem
date posted 18th March 2008 23:59
[EMAIL REMOVED] wrote:
> ----- Original Message -----
> From: "James Herrington" [EMAIL REMOVED]
> To: [EMAIL REMOVED]
> Sent: Wednesday, March 19, 2008 1:00 AM
> Subject: Re: FN-FORUM: Check box problem
>
>
>
>>
>>> How do you check if a Check Box exists using Javascript before you test
>>> if it is checked?
>>>
>>> if (document.getElementById("ALL_Diaries") == true) {
>>>
>>>
>>> }
>>>
>>> doesn't work
>>>
>> I haven't had the time to learn Javascript yet but I suspect if the
>> element isn't found a null value will be returned.
>>
>> Try something like:
>>
>> if (document.getElementById("ALL_Diaries") != null) {
>>
>>
>> }
>>
>> HTH
>> James
>>
>>
>>
>
> They were all null even if they existed when I tried - Pam
>
Like I said my Javascript knowledge is very limited (goes as far as
copying and pasting off hotscripts etc.) but a check on google brings up
this page http://developer.mozilla.org/en/docs/DOM:document.getElementById
Looking under the 'Notes' heading it says that the function will return
null if no element with that id exists.
The only thing I can think of is that different browsers interpret
Javascript differently. The above reference is for Mozilla - what
browser are you using?
James
|
 |
|