SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Stopping me validate my html
-
Aug 20, 2006, 06:32 #1
- Join Date
- Dec 2002
- Location
- uk
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Stopping me validate my html
Hi
I have a script that enables me to show images and the trigger is -
Code:<input type="radio" name="_$Extras" value="0;0;None" checked onClick=changeExtra('/images/empty.gif')>
an attribute value must be a literal unless it contains only name characters.
You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.
If anyone can shed any light i would be grateful.
Thanks
Paul
-
Aug 20, 2006, 07:02 #2
- Join Date
- Oct 2002
- Location
- Lancashire, UK
- Posts
- 3,847
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try: checked="checked" (for XHTML) and onclick="changeExtra('/images/empty.gif');" also add a closing / to the end of the tag (for XHTML)
What are you trying to validate to? HTML 4.0? XHTML?
checked="checked" because XHTML requires all given attributes to also have a value, the double quotes around the changeExtra function call because that is the value of the onclick attribute. The closing tag is for XHTML too, XHTML requires that all tags are closed (etiher with a corresponding closing tag i.e. </input> or inline />)
HTML Code:<input type="radio" name="_$Extras" value="0;0;None" checked="checked" onclick="changeExtra('/images/empty.gif');" />
-
Aug 20, 2006, 07:15 #3
- Join Date
- Dec 2002
- Location
- uk
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Rick,
Sorted!
Thank you kindly :-)
Paul
-
Aug 20, 2006, 07:24 #4
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Rick
Simon Pieters
-
Aug 20, 2006, 07:39 #5
- Join Date
- Dec 2002
- Location
- uk
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I am using an oldish, but VERY flexible javascript shopping basket code (and i'm not going to change it just yet :-)
This requires the $ and the _ in the name file for specific reasons.
This doesn't prevent it from validating i'm glad to say!
There is one line i cannot get through html validation and it must be as it is to work -
Code:<form onSubmit="buy(this);return(false);" name="gift">
required attribute "ACTION" not specified.
Paul
-
Aug 20, 2006, 08:18 #6
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
HTML Code:<form action="" onsubmit="buy(this);return(false);" name="gift">
Simon Pieters
-
Aug 20, 2006, 08:28 #7
- Join Date
- Dec 2002
- Location
- uk
- Posts
- 51
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you kindly.
I never even though of using it blank!
I feel a bit thick as it's that simple........
Thanks again
I'm 100% (well, my html validation is :-)
Paul
Bookmarks