cloudy

Author Topic: Html, Java or php for dated file retrieval - Form Select?  (Read 4826 times)

0 Members and 1 Guest are viewing this topic.

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Html, Java or php for dated file retrieval - Form Select?
« Reply #30 on: November 18, 2007, 06:13:07 PM »
Hi again Kevin

I have success!!!

Your original Form select is working - see this link:

www.buskelundtoften.dk/vejret/test.php

I just have a small issue regarding w3 validation: (3 errors)

Line 107, Column 21: value of attribute "selected" cannot be "yes"; must be one of "selected".
<option selected="yes" value="11" >November</option>

 Line 123, Column 21: value of attribute "selected" cannot be "yes"; must be one of "selected".
<option selected="yes" value="18" >18</option>

 Line 158, Column 21: value of attribute "selected" cannot be "yes"; must be one of "selected".
<option selected="yes" value="2007" >2007</option


Do you know how to make it pass w3 validation?

Best regards,

Henrik

Online saratogaWX

  • Posts: 4,577
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: Html, Java or php for dated file retrieval - Form Select?
« Reply #31 on: November 18, 2007, 06:37:23 PM »
Hi Henrik,

The validator suggests
Quote
For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; a value like “selected="true"” is not allowed.
.  So your line should read either
Code: [Select]
<option selected="selected" value="11" >November</option> or
Code: [Select]
<option selected value="11" >November</option>
Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,859
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Html, Java or php for dated file retrieval - Form Select?
« Reply #32 on: November 18, 2007, 07:48:50 PM »
Actually, the use of Selected in an Option is redundant since the default value is already place in the first position.

You can remove the selected part completely.




All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Html, Java or php for dated file retrieval - Form Select?
« Reply #33 on: November 18, 2007, 07:49:55 PM »
Hi Ken

Thanks for your reply.

I changed selected="yes" to selected="selected" and now it passes w3 validation.

And the script seems to work fine, so I dont know what the difference between "yes" and "selected" is.

Best regards,

Henrik

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Html, Java or php for dated file retrieval - Form Select?
« Reply #34 on: November 18, 2007, 07:50:39 PM »
Actually, the use of Selected in an Option is redundant since the default value is already place in the first position.

You can remove the selected part completely.

Hi Kevin

Thanks - i posted my reply before i saw you have replied too.

Best regards,

Henrik

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,859
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Html, Java or php for dated file retrieval - Form Select?
« Reply #35 on: November 18, 2007, 07:51:49 PM »
selected="selected"  is correct.   selected="yes" is not.

The use of selected however for type Option is not needed since the default is the first entry.  Using it elsewhere lower in the list wil lhave no effect.

It does have an effect on other types like radio buttons.


I've updated the test script at the top of the thread to remove all the selected = "yes" entries.
« Last Edit: November 18, 2007, 07:55:29 PM by TNETWeather »

All you need is Time, Aptitude and Desire ... and you can build just about anything...