Class TextValidation

Text Validation

A DataValidation for a Text Item .

 // Add a text item to a form and require it to be a number within a range. 
 const 
  
 form 
  
 = 
  
 FormApp 
 . 
 create 
 ( 
 'My form' 
 ); 
 const 
  
 textItem 
  
 = 
  
 form 
 . 
 addTextItem 
 (). 
 setTitle 
 ( 
 'Pick a number between 1 and 100?' 
 ); 
 const 
  
 textValidation 
  
 = 
  
 FormApp 
 . 
 createTextValidation 
 () 
  
 . 
 setHelpText 
 ( 
 'Input was not a number between 1 and 100.' 
 ) 
  
 . 
 requireNumberBetween 
 ( 
 1 
 , 
  
 100 
 ) 
  
 . 
 build 
 (); 
 textItem 
 . 
 setValidation 
 ( 
 textValidation 
 ); 
Create a Mobile Website
View Site in Mobile | Classic
Share by: