title: How to set Required area in form with google script?
body: <p>I make a form with Google script</p>
  
  <p>but I don't know how to make it's field to be REQUIRED</p>
  
  <p>following is my script but my gbchk(form) didn't work</p>
  
  <p>The script will add a line in my excel in my google dive</p>
  
  <p>but even there is no data in the form</p>
  
  <p>How to make a required area in google script?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function doGet(e) {
    return HtmlService.createHtmlOutputFromFile('form.html');
  }
  function uploadFiles(form) {
    try {
      
      var folderName = "Upload";
      var sheetName = "ulist";
      var folder;
      var folders = DriveApp.getFoldersByName(folderName);
      
      if (folders.hasNext()) {
        folder = folders.next();
      } else {
        
        folder = DriveApp.createFolder(folderName);
      }
      //handling uploading file
      var blob = form.myFile;    
      var file = folder.createFile(blob);    
      file.setDescription("Uploaded by "+ form.myName);    
      
      var fileUrl = file.getUrl();
      
      
      var FileIterator = DriveApp.getFilesByName(sheetName);
      var sheetApp = "";
      while (FileIterator.hasNext())
      {
        var sheetFile = FileIterator.next();
        if (sheetFile.getName() == sheetName)
        {
          
          sheetApp = SpreadsheetApp.open(sheetFile);
        }    
      }
     
      if(sheetApp == "")
      {
        sheetApp = SpreadsheetApp.create(sheetName);
      }
      
      var sheet = sheetApp.getSheets()[0];
      var lastRow = sheet.getLastRow();
      
            
      var targetRange = sheet.getRange(lastRow+1, 2, 1, 1).setValues([[lastRow+1,form.myName]]);
     
      return "Upload Success!"
      
    } catch (error) {
      
      return "Upload fail because:"+error.toString();
    }
    
  }
  function gbchk(form)                
  {             
    if (form.myName.value == "")                
    {                
      alert("Enter your name!!");                
      form.myName.focus();                
      return (false);                
    }    
    return (true);                
  }                </code></pre>
  </div>
  </div>
  </p>