Added IE7 compat in administersurvey.js for class changes.
This commit is contained in:
parent
afd395ebb6
commit
d6cfcd4381
3 changed files with 17 additions and 15 deletions
|
|
@ -25,7 +25,6 @@ Survey.Form = new function() {
|
|||
|
||||
|
||||
this.displayQuestions = function(params){
|
||||
|
||||
toValidate = new Array();//clear array
|
||||
var qs = params.questions;
|
||||
var s = params.section;
|
||||
|
|
@ -188,8 +187,8 @@ Survey.Form = new function() {
|
|||
for(var z in toValidate[i]['answers']){
|
||||
total += Math.round(document.getElementById(z).value);
|
||||
}
|
||||
console.log(total+" and "+ toValidate[i]['total']);
|
||||
if(total == toValidate[i]['total']){answered = 1;}
|
||||
else{alert("Please enter amounts that sum to 100% to proceed.");}
|
||||
}else{
|
||||
for(var z in toValidate[i]['answers']){
|
||||
var v = document.getElementById(z).value;
|
||||
|
|
@ -197,9 +196,6 @@ console.log(total+" and "+ toValidate[i]['total']);
|
|||
answered = 1;
|
||||
break;
|
||||
}
|
||||
else{
|
||||
console.log(z+' was not answered');
|
||||
}
|
||||
}
|
||||
}
|
||||
if(answered == 0){
|
||||
|
|
@ -365,33 +361,33 @@ console.log(total+" and "+ toValidate[i]['total']);
|
|||
var aid = objs[5];
|
||||
max = parseInt(max);
|
||||
if(maxA == 1){
|
||||
if(b.getAttribute('class') == 'mcbutton-selected'){
|
||||
if(b.className == 'mcbutton-selected'){
|
||||
document.getElementById(b.hid).value = 0;
|
||||
b.setAttribute('class','mcbutton');
|
||||
b.className='mcbutton';
|
||||
}else{
|
||||
document.getElementById(b.hid).value = 1;
|
||||
b.setAttribute('class','mcbutton-selected');
|
||||
b.className='mcbutton-selected';
|
||||
}
|
||||
for(var i in butts){
|
||||
if(butts[i] != b){
|
||||
butts[i].setAttribute('class','mcbutton');
|
||||
butts[i].className='mcbutton';
|
||||
document.getElementById(butts[i].hid).value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(b.getAttribute('class') == 'mcbutton'){
|
||||
else if(b.className == 'mcbutton'){
|
||||
var max = parseInt(document.getElementById(qid+'max').innerHTML);
|
||||
if(max == 0){
|
||||
b.setAttribute('class','mcbutton');
|
||||
b.className='mcbutton';
|
||||
//warn that options used up
|
||||
}
|
||||
else{
|
||||
b.setAttribute('class','mcbutton-selected');
|
||||
b.className='mcbutton-selected';
|
||||
document.getElementById(qid+'max').innerHTML = parseInt(max-1);
|
||||
document.getElementById(b.hid).value = 1;
|
||||
}
|
||||
}else{
|
||||
b.setAttribute('class','mcbutton');
|
||||
b.className='mcbutton';
|
||||
var max = parseInt(document.getElementById(qid+'max').innerHTML);
|
||||
document.getElementById(qid+'max').innerHTML = parseInt(max+1);
|
||||
document.getElementById(b.hid).value = '';
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ Survey.SectionTemplate = new function(){
|
|||
}
|
||||
html = html + "\
|
||||
<hr>\
|
||||
<p>Section Text:</p> <textarea name=sectionText maxlength=2056 cols=50 rows=10>"+ params.sectionText +"</textarea>\
|
||||
<p>Section Text:</p> <textarea name=sectionText maxlength=2056 cols=65 rows=4>"+ params.sectionText +"</textarea>\
|
||||
";
|
||||
html = html + "<p>Title on every page: " + this.makeRadio('everyPageTitle',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageTitle);
|
||||
html = html + "<p>Text on every page: " + this.makeRadio('everyPageText',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageText);
|
||||
|
|
@ -68,7 +68,7 @@ Survey.SectionTemplate = new function(){
|
|||
}
|
||||
|
||||
var form = new YAHOO.widget.Dialog("section",
|
||||
{ width : "400px",
|
||||
{ width : "500px",
|
||||
fixedcenter : true,
|
||||
visible : false,
|
||||
constraintoviewport : true,
|
||||
|
|
|
|||
|
|
@ -55,9 +55,15 @@ input.mcbutton:hover{
|
|||
}
|
||||
input.mcbutton-selected{
|
||||
background-color: #172D9D;
|
||||
background-repeat: repeat-x;
|
||||
color: #FFFFFF;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
margin: 0.5em;
|
||||
padding: .8em;
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
background-image: url(/extras/wobject/Survey/gradient-glossy.png);
|
||||
background-position: 0px 0px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue