17 replies [Last post]
wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

I've got a page that was originally built with a jump menu (and a table). I still need to present this information (you choose the state, and it jumps to that state's listing of stores offering site products), but I don't have any idea how to go about putting something together that will validate 4.01 Strict (I guess without JavaScript??)

("document type does not allow element "OPTION" here.")
("there is no attribute "LANGUAGE".")
etc.](*,)

Sure would appreciate some ideas, or pointers to info somewhere. Tried googling, checking wikis....nothing useful. Crying

Thanks!
Wendy

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 24 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Re: Styling Jump Menus That Validate?

wendy wrote:
("there is no attribute "LANGUAGE".")

Change <script language="javascript"> to <script type="text/javascript">.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Anonymous
Anonymous's picture
Guru

Styling Jump Menus That Validate?

A quick view of the DTD will show you what is permissible:

<!-- script statements, which may include CDATA sections -->
<!ELEMENT script (#PCDATA)>
<!ATTLIST script
  id          ID             #IMPLIED
  charset     %Charset;      #IMPLIED
  type        %ContentType;  #REQUIRED
  src         %URI;          #IMPLIED
  defer       (defer)        #IMPLIED
  xml:space   (preserve)     #FIXED 'preserve'
  >

While "id", "charset", "src" and "defer" are optional "type" is required. "language" is not defined and therefore not permitted. Smile

wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

Styling Jump Menus That Validate?

OK! Thanks Laughing out loud

Changing to <script type="text/javascript"> fixes a *lot*...but I still get this error:

"...document type does not allow element "SELECT" here; missing one of "P", "H1", [...etc...] start-tag."

Sorry to be so ignorant, but this is not anything I ever deal with (at least, not since table days Wink )

So near, and yet...(etc, etc) :roll:

Anonymous
Anonymous's picture
Guru

Styling Jump Menus That Validate?

wendy wrote:
OK! Thanks Laughing out loud

Changing to <script type="text/javascript"> fixes a *lot*...but I still get this error:

"...document type does not allow element "SELECT" here; missing one of "P", "H1", [...etc...] start-tag."

Sorry to be so ignorant, but this is not anything I ever deal with (at least, not since table days Wink )

So near, and yet...(etc, etc) :roll:Can you show a link? Smile

wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

Styling Jump Menus That Validate?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 24 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Styling Jump Menus That Validate?

My guess would be change onChange to onchange - can't have any capitals.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

Styling Jump Menus That Validate?

<sigh>Unfortunately, doesn't seem to be...changed all UC to LC, and still get the same errors. Crying

Is there some other way to go about presenting this information, I wonder? :-s Or just turn it into a long list and forget about trying to get fancy? (or vaguely accessible...)

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 24 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Styling Jump Menus That Validate?

I think you need a <fieldset> inside your <form> for strict doctypes.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Anonymous
Anonymous's picture
Guru

Styling Jump Menus That Validate?

Link doesn't work for me. Sad

wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

Styling Jump Menus That Validate?

It's definitely there...are you getting an error? Shock

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 24 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Styling Jump Menus That Validate?

Tyssen wrote:
I think you need a <fieldset> inside your <form> for strict doctypes.

Did you do this yet?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 10 years 27 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Styling Jump Menus That Validate?

It doesn't have to be a fieldset, but there needs to be some block level container between the <form> and the control elements, which are all classified as inline. A <form> is much like a <body> in strict, it can only contain block level elements (except other forms).

HTML 4.01 strict DTD wrote:

<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->

where %block is defined to be all block tags

wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

Styling Jump Menus That Validate?

Tyssen wrote:

I think you need a <fieldset> inside your <form> for strict doctypes.

Did you do this yet?

I'm trying to work out exactly *where* to put it (or any block element)...using fieldset as any kind of containing tag of course introduces a fieldset format. I've tried using <p>, but that gives an error, too.

Wish the validator was less inscrutible :? or, I was more clever. Sad

If anyone can get more specific, I'm listening. Meanwhile, I'll keep fiddling.

Anonymous
Anonymous's picture
Guru

Styling Jump Menus That Validate?

        </div>
        <!--end header-->
        <!-- InstanceBeginEditable name="content" -->
        <div id="content">
			<form name="stockists" method="post" action="">
			<fieldset><legend>Find Your Local  Stockist </legend>
<select name="select" size="1"  onchange="MM_jumpMenu('parent',this,0)">

A plain paragraph tag also validates in place of the fieldset and legend if you don't want to move the "Find Your Local Stockist" out of the h1.

wendy
wendy's picture
Offline
Enthusiast
Boston, MA
Last seen: 13 years 20 weeks ago
Boston, MA
Timezone: GMT-5
Joined: 2005-01-31
Posts: 174
Points: 0

Styling Jump Menus That Validate?

Thanks very much - I've used enclosed everything contained within <form> in a <p>, and it does validate. Phew!

In the meanwhile, it dawned on me that maybe this list ought to be, er...a list. Probably should be. = more work. = oh, yay. Evil

I came across a discussion in the Web Standards Group archive, which I'm mentioning in case anybody else is considering such things. Do a search for "jump menu" (not sure if you have to join to search).

And in case that's skipped, here is what the author recommends for the way to go (well, *a* way to go):
http://www.brothercake.com/dropdown/

And more info, pro/con + various "solutions":
http://snipurl.com/n3lj

Thanks very much for sticking this out despite all my whining!

My next question is how to open a new page without using "target", but I'm guessing that's been answered a million times already, so will search.

Laughing out loud

Anonymous
Anonymous's picture
Guru

Styling Jump Menus That Validate?

wendy wrote:
My next question is how to open a new page without using "target", but I'm guessing that's been answered a million times already, so will search.
It probably has been gone over before. http://www.alistapart.com/articles/popuplinks/

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 24 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Styling Jump Menus That Validate?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference