View Issue Details

IDProjectCategoryView StatusLast Update
04736User patches[All Projects] Theme editorpublic2010-12-14 13:02
Reporteruser10654Assigned ToDenisChenu  
PriorityhighSeveritymajor 
Status closedResolutionfixed 
Product Version1.90+ 
Target VersionFixed in Version1.90 
Summary04736: Major mistake in html code
Description

Hello, my name is Francesco
I'm working with LimeSurvey 1.90 (limesurvey190plus-build9459-20101109) and I found some syntax errors during the html validation, for someone of this I found a possible solution.

1)In the file survey/index.php the code that draws the captcha puts a tag <p> (line 2106) around the welcome text (plase confirm access ...) but not close it.

//code
2016:: echo "<p class='captcha'>".$clang->gT("Please confirm access to survey by answering the security question below and click continue.")."<br /><p>

//patch
2016:: echo "<p class='captcha'>".$clang->gT("Please confirm access to survey by answering the security question below and click continue.")."<br /></p>

2)In the file survey/index.php on the line 2130 there is a TD with wrong attribute.

//code
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='center'><img src='$rooturl/verification.php?sid=$surveyid' /></td>

//patch
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='middle'><img src='$rooturl/verification.php?sid=$surveyid' /></td>

3)In the file survey/index.php on the line 2130 the IMG tag missed the ALT attribute

//code
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='middle'><img src='$rooturl/verification.php?sid=$surveyid' /></td>

//patch
add alt tag
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='middle'><img src='$rooturl/verification.php?sid=$surveyid' alt=""/></td>

4)In the file survey/index.php on the line 1067 this code '$htmlcode .= "selected"' put the 'selected' attribute in a form select but the correct attribute is 'selected=selected'.

//code
1067::$htmlcode .= "selected";

//patch
1067::$htmlcode .= " selected='selected'";

5)In the file survey.php, question.php and group.php you put the tag AUTOCOMPLETE=OFF in every FORM, this works but is wrong for the validation process.

A possible solution (tested) is the removal of AUTOCOMPLETE tag from every form and create a new file (eg. autocomplete.js) with the following javascript code

var allforms = document.getElementsByTagName("form");
for (var f = 0; f < allforms.length; f++){
allforms[f].setAttribute("autocomplete", "off");
}

Now put this file on survey/scripts folder, then add this line

. "<script type=\"text/javascript\" src=\"".$rooturl."/scripts/autocomplete.js\"></script>\n"

to survey/common.php file at line 4208

6)When you create a question such as that one on the second page of your survey (http://survey.limesurvey.org/index.php "Please rate your skills in the following domains:"), every sub-questions is inside a <tbody> tag, all this tag are nested inside another <tbody> and for this reason the page can not be validated. The <tbody> can not contain another <tbody>.

If I find other errors you mark them

TagsNo tags attached.
Complete LimeSurvey version number (& build)9459

Activities

user10654

2010-11-12 16:12

 

segnalazione_bug_limesurvey.txt (3,212 bytes)
Hello, my name is Francesco 
I'm working with LimeSurvey 1.90 (limesurvey190plus-build9459-20101109) and I found some syntax errors during the html validation, for someone of this I found a possible solution.

1)In the file survey/index.php the code that draws the captcha puts a tag <p> (line 2106) around the welcome text (plase confirm access ...) but not close it.

//code
2016:: echo "<p class='captcha'>".$clang->gT("Please confirm access to survey by answering the security question below and click continue.")."<br /><p>

//patch
2016:: echo "<p class='captcha'>".$clang->gT("Please confirm access to survey by answering the security question below and click continue.")."<br /></p>



2)In the file survey/index.php on the line 2130 there is a TD with wrong attribute.

//code
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='center'><img src='$rooturl/verification.php?sid=$surveyid' /></td>

//patch
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='middle'><img src='$rooturl/verification.php?sid=$surveyid' /></td>



3)In the file survey/index.php on the line 2130 the IMG tag missed the ALT attribute

//code
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='middle'><img src='$rooturl/verification.php?sid=$surveyid' /></td>

//patch
add alt tag 
2130:: <td align='center' valign='middle'><label for='captcha'>".$clang->gT("Security question:")."</label></td><td align='left' valign='middle'><table><tr><td valign='middle'><img src='$rooturl/verification.php?sid=$surveyid' alt=""/></td>



4)In the file survey/index.php on the line 1067 this code '$htmlcode .= "selected"' put the 'selected' attribute in a form select but the correct attribute is 'selected=selected'.

//code
1067::$htmlcode .= "selected";

//patch
1067::$htmlcode .= " selected='selected'";


5)In the file survey.php, question.php and group.php you put the tag AUTOCOMPLETE=OFF in every FORM, this works but is wrong for the validation process.

A possible solution (tested) is the removal of AUTOCOMPLETE tag from every form and create a new file (eg. autocomplete.js) with the following javascript code

var allforms = document.getElementsByTagName("form");
	for (var f = 0; f < allforms.length; f++){
		allforms[f].setAttribute("autocomplete", "off");
	}
	
Now put this file on survey/scripts folder, then add this line

 . "<script type=\"text/javascript\" src=\"".$rooturl."/scripts/autocomplete.js\"></script>\n"
 
to survey/common.php file at line 4208


6)When you create a question such as that one on the second page of your survey (http://survey.limesurvey.org/index.php "Please rate your skills in the following domains:"), every sub-questions is inside a <tbody> tag, all this tag are nested inside another <tbody> and for this reason the page can not be validated. The <tbody> can not contain another <tbody>.

If I find other errors you mark them



	


user10654

2010-11-12 16:14

  ~13511

I'm sorry but the main post is missing some parts of code that were obviously cut ... I attach a file with the complete code.

DenisChenu

DenisChenu

2010-11-12 17:12

developer   ~13512

Last edited: 2010-11-12 17:18

View 3 revisions

Yep,

There are a lot of 'not valid' html bug in LimeSurvey.

The problem : when we modify some html part, there can be have repercussion on template.

We had 10 template to review, and sme user have problem in there template.

Big big job here ....

For the first : OK, trivial, maybe remove the < br > too
2) I don't like the td align .... one class for the row and onefor each cell seem best. But need a global css for all survey.
3) Maybe put the captcha in a definition list (and same remark than before).
4) seem OK for me
5) Bof, put the autocomplete=off in javascript made the page goes to the w"c validator but .... i don't sure is very interesting.

For the 6:

We have a table in a table:
table / tbody / table /tbody,

we don't have tbody->tbdy if i don't make error. It's OK, no ?

DenisChenu

DenisChenu

2010-11-13 11:25

developer   ~13521

Last edited: 2010-11-13 11:25

View 2 revisions

Fixed 1,2,3,4,5, in 9480 . 2 need some optimisation (1.91). 5 and 6 for 1.91.

Issue History

Date Modified Username Field Change
2010-11-12 16:05 user10654 New Issue
2010-11-12 16:12 user10654 File Added: segnalazione_bug_limesurvey.txt
2010-11-12 16:14 user10654 Note Added: 13511
2010-11-12 17:12 DenisChenu Note Added: 13512
2010-11-12 17:14 DenisChenu Note Edited: 13512 View Revisions
2010-11-12 17:18 DenisChenu Note Edited: 13512 View Revisions
2010-11-13 00:01 c_schmitz Project Bug reports => User patches
2010-11-13 11:18 DenisChenu Assigned To => DenisChenu
2010-11-13 11:18 DenisChenu Status new => assigned
2010-11-13 11:25 DenisChenu Note Added: 13521
2010-11-13 11:25 DenisChenu Note Edited: 13521 View Revisions
2010-11-13 11:25 DenisChenu Status assigned => confirmed
2010-11-13 11:26 DenisChenu Status confirmed => resolved
2010-11-13 11:26 DenisChenu Fixed in Version => 1.90
2010-11-13 11:26 DenisChenu Resolution open => fixed
2010-12-14 13:02 c_schmitz Status resolved => closed
2015-12-11 14:40 c_schmitz Category Templates => Theme editor