W3C Validation

Help with installation and general calendar setttings

W3C Validation

Postby nipper » Fri Jun 17, 2011 7:15 pm

Any clues as to overcome validation errors? I am trying to stay all XHTML 1.0 Strict, but have 8 errors in html, not including several in CSS for the calendar only. Tried commenting Javascript but no result. Help!
nipper
 
Posts: 3
Joined: Fri Jun 17, 2011 12:03 am

Re: W3C Validation

Postby chris » Fri Jun 17, 2011 8:20 pm

Hi,
Without saying what the errors are it is going to pretty hard to help you ;)
Do you have an url?

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: W3C Validation

Postby nipper » Fri Jun 17, 2011 9:45 pm

Thanks for the reply:

Here they are


1. Error Line 102, Column 23: required attribute "action" not specified

<form method="get">



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>.
2. Error Line 103, Column 73: 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

<select name="id_item" class="select" onchange="this.form.submit();">



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>").
3. Error Line 120, Column 13: value of attribute "id" invalid: "0" cannot start a name

<div id="06_2011" class="cal_month load_cal"></div><div id="7_2011" class="c…



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
4. Error Line 120, Column 64: value of attribute "id" invalid: "7" cannot start a name

…s="cal_month load_cal"></div><div id="7_2011" class="cal_month load_cal"></div…



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
5. Error Line 120, Column 114: value of attribute "id" invalid: "8" cannot start a name

…s="cal_month load_cal"></div><div id="8_2011" class="cal_month load_cal"></div…



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
6. Error Line 120, Column 164: value of attribute "id" invalid: "9" cannot start a name

…s="cal_month load_cal"></div><div id="9_2011" class="cal_month load_cal"></div…



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
7. Error Line 120, Column 214: value of attribute "id" invalid: "1" cannot start a name

…s="cal_month load_cal"></div><div id="10_2011" class="cal_month load_cal"></di…



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
8. Error Line 120, Column 265: value of attribute "id" invalid: "1" cannot start a name

…s="cal_month load_cal"></div><div id="11_2011" class="cal_month load_cal"></di…



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.
nipper
 
Posts: 3
Joined: Fri Jun 17, 2011 12:03 am

Re: W3C Validation

Postby chris » Fri Jun 17, 2011 10:10 pm

1. Error Line 102, Column 23: required attribute "action" not specified

<form method="get">

OK, so add an action to the form.

2. Error Line 103, Column 73: 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

<select name="id_item" class="select" onchange="this.form.submit();">

It looks like you should place the <select> within a block element.

3. Error Line 120, Column 13: value of attribute "id" invalid: "0" cannot start a name

<div id="06_2011" class="cal_month load_cal"></div><div id="7_2011" class="c…

This one is going to be slightly harder to fix.
The code uses the "id" attribute to know which month to show. So, either you add a string before it and then strip it out with JavaScript or you modify the php code to insert the month and year in a different attribute (eg "rel" and modify the JavaScript to read that value instead of the "id".

The remaining warnings are all the same as this one, i.e. the id should not start with a digit. I have never managed to find out why this is the case.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: W3C Validation

Postby nipper » Fri Jun 17, 2011 10:29 pm

Hi Chris, Thanks again, solved first 2, but need a bit of time to work out others. Keep you posted if I produce a solution. Thanks
nipper
 
Posts: 3
Joined: Fri Jun 17, 2011 12:03 am

Re: W3C Validation

Postby Travelfrog » Fri Jun 24, 2011 12:57 pm

Downloaded the calendar yesterday.

Have the same XHTML validation errors with the id. Has anyone managed to find a fix for this yet?
Travelfrog
 
Posts: 7
Joined: Fri Jun 24, 2011 12:39 pm

Re: W3C Validation

Postby kuczora » Thu Jul 07, 2011 2:52 pm

The code uses the id of the div to store the month and year, separated by an underscore. (e.g. 7_2011)

You can add another underscore to the end of the id and then anything else you want without breaking the code, but that doesn't help with the validation issue.

To fix that, first modify cal.inc.php line 87 thus:
Code: Select all
      //   add month layer to page - calendar loaded via ajax
      $calendar_months.='<div id="'.$this_month.'_'.$this_year.'" class="cal_month load_cal"></div>';

to something like:
Code: Select all
      //   add month layer to page - calendar loaded via ajax
      $calendar_months.='<div id="month_'.$this_month.'_'.$this_year.'" class="cal_month load_cal"></div>';

YOU MUST END THE PREFIX WITH AN UNDERSCORE!

Then you need to modify the JavaScript side of things, in mootools-cal-public.js and also mootools-cal-admin.js - here are the changes for -public.js:

Lines 66 and 67 and also 84 and 85
Code: Select all
               //   convert to numeric
               cur_month   = parseFloat(data[0]);
               new_year   = parseFloat(data[1]);

becomes
Code: Select all
               //   convert to numeric
               cur_month   = parseFloat(data[1]);
               new_year   = parseFloat(data[2]);


Line 113
Code: Select all
         var data=this_date.split('_');
         load_calendar(el,data[0],data[1]);

becomes
Code: Select all
         var data=this_date.split('_');
         load_calendar(el,data[1],data[2]);

I have to say that I haven't tested this, but hopefully it will point you in the right direction.
kuczora
 
Posts: 24
Joined: Thu Jun 23, 2011 1:52 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron