Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: Check box problem

date posted 19th March 2008 00:07


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

I've just found this - http://www.thescripts.com/forum/thread90845.html

Sounds like a solution to your problem and it also gives a pretty good
explanation as to what is going on.

Hopefully that should work.

James



Messages by Day
March 31st 2008
March 30th 2008
March 29th 2008
March 28th 2008
March 27th 2008
March 26th 2008
March 25th 2008
March 24th 2008
March 23rd 2008
March 22nd 2008
March 21st 2008
March 20th 2008
March 19th 2008
March 18th 2008
March 17th 2008
March 16th 2008
March 15th 2008
March 14th 2008
March 13th 2008
March 12th 2008
March 11th 2008
March 10th 2008
March 9th 2008
March 8th 2008
March 7th 2008
March 6th 2008
March 5th 2008
March 4th 2008
March 3rd 2008
March 2nd 2008
March 1st 2008


Messages by Month
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000