Reply
onload validation problem
Old 06-05-2007, 02:17 PM onload validation problem
Junior Talker

Posts: 3
Name: Daniel
Hi folks,
Im trying to get the following section of code to validate. However I have no idea what is wrong with it..

Code:
<a href="#" target="_blank" onclick="openLiveHelp(); return false"><img src="http://www.mydomain.co.uk/livehelp/include/status.php" id="LiveHelpStatus" name="LiveHelpStatus" border="0" alt="Live Help" onload="statusImagesLiveHelp[statusImagesLiveHelp.length] = this;"/></a>
This code is entered in the body of the page. The doctype is..

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The error I am getting with the validator is..



Any help with this would be appreciated.

Many thanks.

Dan
Daniel@EZPZ is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 06-05-2007, 02:39 PM Re: onload validation problem
willcode4beer's Avatar
Webmaster Talker

Posts: 695
Name: Paul Davis
Location: San Francisco
You have left out the error message.
However, from looking at your post, I can tell you that there is no onload attribute for the img tag in XHTML so, that is probably your first validation error. To fix, remove it
__________________
Paul Davis
willCode4Beer.com (coding for all the right reasons)
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 06-05-2007, 03:48 PM Re: onload validation problem
LadynRed's Avatar
Super Moderator

Posts: 6,562
Location: Tennessee
The "target" attribute is deprecated in XHTML and should not be used - and that is also a likely error message source.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club

Last edited by LadynRed : 06-05-2007 at 03:50 PM.
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-05-2007, 04:12 PM Re: onload validation problem
Junior Talker

Posts: 3
Name: Daniel
It was the onload causing a problem with a "no attribute" message however I had no idea what that meant.

Removing it has fixed the issue, I assumed removing it would stop something from working but everything seems normal so far, odd!

Thanks for you help folks
Daniel@EZPZ is offline
Reply With Quote
View Public Profile
 
Old 06-05-2007, 05:21 PM Re: onload validation problem
tripy's Avatar
Fetchez la vache!

Posts: 2,055
Name: Thierry
Location: In the void
This onclick was triggered only uppon a click on the link.
Your link should be non-working now, if you simply removed the onclick.

And be warned that the target= attribute is deprecated too in the xhtml strict doctype.
Your code will only validate on xhtml/transitional
Migrate the onclick into the href to have it valid and operational:
HTML Code:
<a href="javascript:openLiveHelp();" target="_blank" ><img src="http://www.mydomain.co.uk/livehelp/include/status.php" id="LiveHelpStatus" name="LiveHelpStatus" border="0" alt="Live Help" onload="statusImagesLiveHelp[statusImagesLiveHelp.length] = this;"/></a>
__________________
Listen to the ducky: "This is awesome!!!"


Last edited by tripy : 06-05-2007 at 05:23 PM.
tripy is offline
Reply With Quote
View Public Profile
 
Old 06-05-2007, 06:33 PM Re: onload validation problem
Junior Talker

Posts: 3
Name: Daniel
Thanks tripy - the link seems to work fine without it which is odd.

I'll try your suggestion in the morning incase i've missed something, its late here in the UK

Dan
Daniel@EZPZ is offline
Reply With Quote
View Public Profile
 
Old 06-05-2007, 07:10 PM Re: onload validation problem
tripy's Avatar
Fetchez la vache!

Posts: 2,055
Name: Thierry
Location: In the void
Central Europe here...
1 hour ahead of you even, but it's true I'm getting a bit tired...

Have a good rest.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to onload validation problem
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13810 seconds with 12 queries