The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Validation Error: required attribute "src" not specified
Barons
post Sep 2 2011, 01:41 AM
Post #1


Member
***

Group: Members
Posts: 70
Joined: 7-November 10
Member No.: 13,091



Hello,

Can anyone help me fix this? I'm not sure what I'm missing. I've getting an error that says my src isn't specified but i'm not sure how to.


QUOTE

Validation Output: 2 Errors

Line 18, Column 76: required attribute "src" not specified
<img id="redset" width="190" height="18" alt="red set of love" class="c1" />

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

Line 19, Column 78: required attribute "src" not specified
<img id="blueset" width="190" height="18" alt="blue set of love" class="c1" />

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.


CODE

<div id="divresult" class="small c4">
<img id="redball" class="c1" src="love/red-1.gif" height="168" width="168" alt="Love" />
<img id="blueball" class="c1" src="love/blue-10.gif" height="168" width="168" alt="Love" />
</div>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Sep 2 2011, 01:52 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



The validation result doesn't match the code snippet you posted.
Can you post the url to the page you tried to validate? You also might try the WDG validator (link at top/bottom of this page), which points you to relevant parts of the HTML reference.

Anyway, src is required for the <img> tag, see http://htmlhelp.com/reference/html40/special/img.html .
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Barons
post Sep 2 2011, 01:59 AM
Post #3


Member
***

Group: Members
Posts: 70
Joined: 7-November 10
Member No.: 13,091



Thanks so much for the help. I haven't figured out what the issue is.

Here's the full code.

CODE
<div id="imgbar">
<img id="redset" width="190" height="18" alt="red set of love" class="c1" />
<img id="blueset" width="190" height="18" alt="blue set of love" class="c1" />
</div>

<p class="c3"><input type="button" id="spinButton" value="SQUEEZE THOSE BALLS HARD" class="small c2" onclick="spin()" /></p>

<div id="divresult" class="small c4">
<img id="redball" class="c1" src="love/red-1.gif" height="168" width="168" alt="Love" />
<img id="blueball" class="c1" src="love/blue-10.gif" height="168" width="168" alt="Love" />
</div>

<div id="divVerdict" class="medium c5">
</div>


http://validator.w3.org/check?uri=http%3A%...Validator%2F1.2

http://www.chastity.freehosting.com/test.html

I've trying to validate a page with a lot of errors on it so i'm going though and pulling out bits of code and working on it one part at a time.

This post has been edited by Barons: Sep 2 2011, 02:02 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Barons
post Sep 2 2011, 02:08 AM
Post #4


Member
***

Group: Members
Posts: 70
Joined: 7-November 10
Member No.: 13,091



never mind i found it. Sorry i was looking in the wrong place
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Sep 2 2011, 02:15 AM
Post #5


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Ok, in the div id="imgbar", you have specified two images using the <img> tag, but there's no SRC pointing to an image. You can't use the <img> tag without an src, eg <img src="path/image.jpg">. SRC a required attribute, as you can see in the link I posted. All that you see is the ALT tag.

BTW, the other two images, in div id="divresult", return 404 not found errors.

In the meantime, you have changed the page, leaving only the #imgbar div and its content. Weird enough, both the WDG and W3C validators now return no errors. blink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Barons
post Sep 2 2011, 03:15 AM
Post #6


Member
***

Group: Members
Posts: 70
Joined: 7-November 10
Member No.: 13,091



QUOTE(Frederiek @ Sep 2 2011, 03:15 AM) *

Ok, in the div id="imgbar", you have specified two images using the <img> tag, but there's no SRC pointing to an image. You can't use the <img> tag without an src, eg <img src="path/image.jpg">. SRC a required attribute, as you can see in the link I posted. All that you see is the ALT tag.

BTW, the other two images, in div id="divresult", return 404 not found errors.

In the meantime, you have changed the page, leaving only the #imgbar div and its content. Weird enough, both the WDG and W3C validators now return no errors. blink.gif



I have no idea why it was validating if it shouldn't be. That page has a lot of java script (That I don't know anything about) in it and something in it was tied into they two images that were there. I didn't want to use the images but any way I tried to delete them makes the java script stop working.

I'm sure I'll have more questions but now I'm slowly making progress again. So I'll say this is done for now. =P
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Sep 2 2011, 10:11 AM
Post #7


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



What page has a lot of javascripts? There's a little in the default file of the folder "love", when I go there directly, trying to find the missing images.

In fact, I found the, what I thought were real, "images" at the root level, only to find out that they are not images, but (the same) web pages. You can't load web pages as images, like you tried in your test page.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Barons
post Sep 2 2011, 11:52 AM
Post #8


Member
***

Group: Members
Posts: 70
Joined: 7-November 10
Member No.: 13,091



QUOTE(Frederiek @ Sep 2 2011, 11:11 AM) *

What page has a lot of javascripts? There's a little in the default file of the folder "love", when I go there directly, trying to find the missing images.

In fact, I found the, what I thought were real, "images" at the root level, only to find out that they are not images, but (the same) web pages. You can't load web pages as images, like you tried in your test page.


http://www.chastity.freehosting.com/files/mistress/good.php

I managed to make all the pages validate last night. I'm not sure if its really valid but it passes here.
http://validator.w3.org/check?uri=http%3A%...ine&group=0

I think a lot of the issue I had were due to the xhtml doc type I was using. I've never used it before so I switched to html strict and I still had a lot of errors but I understood how to fix them. I'm still using this code though.

CODE
<div id="imgbar">
<img id="redset" width="190" height="18" src="#" alt="red set of love" style="visibility:hidden">
<img id="blueset" width="190" height="18" src="#" alt="blue set of love" style="visibility:hidden">
</div>


I can't remove the <img id="redset" / <img id="blueset" without it breaking the JS. It's passing validating and doesn't seem to be causing any harm so I'm going to leave it as is unless there's an easy way to fix it.

This post has been edited by Barons: Sep 2 2011, 11:53 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 2 2011, 04:14 PM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



CODE
I managed to make all the pages validate last night. I'm not sure if its really valid but it passes here.
[url=http://validator.w3.org/check?uri=http%3A%2F%2Fwww.chastity.freehosting.com%2Ffiles%2Fmistress%2Fgood.php&charset=%28detect+automatically%29&doctype=Inline&group=0]http://validator.w3.org/check?uri=http%3A%...ine&group=0[/url]


Then it is valid. Or at least it was. Now you have 4 errors. I'd say 7, because I think the 3 warnings really are errors.



QUOTE
I think a lot of the issue I had were due to the xhtml doc type I was using. I've never used it before so I switched to html strict and I still had a lot of errors but I understood how to fix them.


Good for you. HTML 4.01 Strict > XHTML Transitional. wink.gif

QUOTE

I'm still using this code though.

CODE
<div id="imgbar">
<img id="redset" width="190" height="18" src="#" alt="red set of love" style="visibility:hidden">
<img id="blueset" width="190" height="18" src="#" alt="blue set of love" style="visibility:hidden">
</div>


I can't remove the <img id="redset" / <img id="blueset" without it breaking the JS. It's passing validating and doesn't seem to be causing any harm so I'm going to leave it as is unless there's an easy way to fix it.


I don't follow. Why do you want to remove it? Nothing wrong with it that I can see.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Barons
post Sep 2 2011, 09:14 PM
Post #10


Member
***

Group: Members
Posts: 70
Joined: 7-November 10
Member No.: 13,091



Yea it looks like the code I just added to the site to put ads on it isn't valid. I'll get it sorted out. =)

Thanks for all the help.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 9 2011, 08:55 AM
Post #11


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



Moved off-topic posts here: http://forums.htmlhelp.com/index.php?showtopic=14783
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 05:26 PM