Hi. I have some code for a javascript jump menu... It validated with
HTML 4.0 but now does not validate with XHTML strict 1.0.
I have used name atributes in my code which aparantly are not allowed
now. I have spent all day trying to figure out a solution with no
luck. I have tried document.forms[0] and various other things but
havent known exactly what to do with them and couldn't get them to
work. Below I will show you my current code and what the w3c.org
validator comes up with. If someone could change this code for me to
be XHTML valid I would be very grateful.
-------------------------
My HTML
<form name="jump" action ="">
<script type="text/javascript">
function jumpMenu(){
location=document.jump.menu.options[document.jump.menu.selectedIndex].value;
}
</script>
<select name="menu"
style="font-family:'Verdana';color:#000000;background-color:#99CCFF;font-size:10pt;">
<option value="index.html">HOME</option>
<option value="about.html">About Us</option>
<option value="#">-----------------</option>
<option value="showroom.html">Show Room</option>
<option value="dining.html">-Dining</option>
<option value="prints.html">-Prints</option>
<option value="mirrors.html">-Mirrors</option>
<option value="accessories.html">-Accessories</option>
<option value="lighting.html">-Lighting</option>
<option value="#">-----------------</option>
<option value="glazing.html">Glazing & Boarding</option>
<option value="laminated.html">Laminated Glass</option>
<option value="processing.html">Processing</option>
<option value="design.html">Design</option>
<option value="stained.html">Stained & Leaded</option>
<option value="#">-----------------</option>
<option value="contact.html">Contact Us</option>
</select>
<a href="javascript:jumpMenu();"><img src="go.jpg" alt="Go!"
/></a>
</form>
------------------
w3c validator results
Line 51, column 13: there is no attribute "name"
<form name="jump" action ="">
You have used the attribute named above in your document, but the
document type you are using does not support that attribute for this
element. This error is often caused by incorrect use of the "Strict"
document type with a document that uses frames (e.g. you must use the
"Transitional" document type to get the "target" attribute), or by
using vendor proprietary extensions such as "marginheight" (this is
usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in
the document type you are using, as an undefined element will have no
supported attributes; in this case, see the element-undefined error
message for further information.
How to fix: check the spelling and case of the element and attribute,
(Remember XHTML is all lower-case) and/or check that they are both
allowed in the chosen document type, and/or use CSS instead of this
attribute.
Line 57, column 108: document type does not allow element "select"
here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div",
"pre", "address", "fieldset", "ins", "del" start-tag
....ground-color:#99CCFF;font-size:10pt;">
The mentioned element is not allowed to appear in the context in which
you've placed it; the other mentioned elements are the only ones that
are both allowed there and can contain the element mentioned. This
might mean that you need a containing element, or possibly that you've
forgotten to close a previous element.
One possible cause for this message is that you have attempted to put
a block-level element (such as "<p>" or "<table>") inside an inline
element (such as "<a>", "<span>", or "<font>").
Line 76, column 36: document type does not allow element "a" here;
missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre",
"address", "fieldset", "ins", "del" start-tag
<a href="javascript:jumpMenu();"><img src="go.jpg" alt="Go!" /></a>
---------------------------------------------
Thanks in advance
Daniel Callus 2 2802
On Thu, 07 Apr 2005 13:50:40 -0700, piraticman wrote: Hi. I have some code for a javascript jump menu... It validated with HTML 4.0 but now does not validate with XHTML strict 1.0.
I have used name atributes in my code which aparantly are not allowed now.
You have two small problems, but they should be easy to fix.
Line 51, column 13: there is no attribute "name"
<form name="jump" action ="">
From the HTML 4.01 spec
<http://www.w3.org/TR/html401/interact/forms.html#adef-name-FORM>:
name = cdata
[CI]
This attribute names the element so that it may be referred to from
style sheets or scripts. Note. This attribute has been included for
backwards compatibility. Applications should use the id attribute to
identify elements.
So, change "name" to "id".
Line 57, column 108: document type does not allow element "select" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
...ground-color:#99CCFF;font-size:10pt;">
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
In HTML strict and XHTML strict, the "form" element cannot directly
contain "input", "select", etc. The "form" element has to
contain a block container element, like "p" or "div", which in turn
contains the "select".
See the examples from the HTML spec linked above for how to do it right. pi********@gmail.com wrote: Hi. I have some code for a javascript jump menu... It validated with HTML 4.0 but now does not validate with XHTML strict 1.0.
You multiposted this and got answers elsewhere. Please post to one
group only in future, and select the right group. Multiposting is bad.
Don't do multipost, mm'kay?
Questions that are specifically about HTML, including XHTML, should
normally be posted to comp.infosystems. www.authoring.html.
--
Yucca, http://www.cs.tut.fi/~jkorpela/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: TheKeith |
last post by:
I heard that the name attribute is deprecated in html 4.01 strict. Is it
recommended that you use the ID attribute for images along with the
getElementById method instead of the old way? Thanks.
|
by: Haines Brown |
last post by:
I have a document with a set of internal links such as:
<a name="Z1"></a>...
<a name="Z2"></a>...
The W3C validator objects to the first instance of the name attribute:
There is no attribute...
|
by: Martin Lucas-Smith |
last post by:
I am wanting to know whether are XHTML1-valid characters for use
within an id attribute and/or a name attribute.
...
|
by: aragon |
last post by:
Hi all,
is it legal to use a fully-numeric string as "name" attribute for the
<select> tag in the XHTML standard?
E.g.:
<form action="action.php" method="get">
<select name="12345">
<option...
|
by: piraticman |
last post by:
Hi. I have some code for a javascript jump menu... It validated with
HTML 4.0 but now does not validate with XHTML strict 1.0.
I have used name atributes in my code which aparantly are not...
|
by: Simon Barnett |
last post by:
Hi,
RE: Converting pages including ASP pages for XHTML
My question relates to ASP not ASP.NET - I can't find a newsgroup for ASP
and hoped it was still relevant in ASP.NET - sorry if it's not....
|
by: Chameleon |
last post by:
This code does not working in Mozilla. Works fine in IE.
--------------
<input type=text value=100 name=textbox>
<script>
alert(textbox);
</script>
--------------
This perhaps, because of...
|
by: Inta_Rob |
last post by:
Hi all,
I'm writing a site using C#/ASP.Net 2.0 and trying to make the
resulting code valid XHTML 1.0 Strict, and i'm running into problem
with the auto generation of the <form> tag.
...
|
by: Radu |
last post by:
Hi. I have been working at home on a web project (VSNET 2005 SP1). Now
I have brought the project at work, and I suddenly have plenty of
warnings like:
Validation (XHTML 1.0 Transitional) -...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
|
by: SueHopson |
last post by:
Hi All,
I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...
| |