File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ function  escValue ( val )  { 
2+   if  ( typeof  val  ===  'string' )  { 
3+       return  ( val  ||  "" ) . replace ( / (? ! ^ ) ( [ ' ] ) (? ! $ ) / g,  "\\$1" ) ; 
4+   } 
5+   return  val ; 
6+ } 
7+ 
18function  init ( Survey ,  $ )  { 
29  $  =  $  ||  window . $ ; 
310  var  widget  =  { 
@@ -35,7 +42,7 @@ function init(Survey, $) {
3542            values  =  [ values ] ; 
3643          } 
3744          values . forEach ( function ( value )  { 
38-             $el . find ( "input[value='"  +  value  +  "']" ) . iCheck ( "check" ) ; 
45+             $el . find ( "input[value='"  +  escValue ( value )  +  "']" ) . iCheck ( "check" ) ; 
3946          } ) ; 
4047        }  else  { 
4148          question . generatedVisibleRows . forEach ( function ( row ,  index ,  rows )  { 
@@ -45,7 +52,7 @@ function init(Survey, $) {
4552                  "input[name='"  + 
4653                    row . fullName  + 
4754                    "'][value='"  + 
48-                     row . value  + 
55+                     escValue ( row . value )  + 
4956                    "']" 
5057                ) 
5158                . iCheck ( "check" ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments