Passing array input values to code.gs

By user7428112

I have a form and I want to initialized the input value “urlname[]” by another Global array value and pass the value to code.gs “downloadthefile()” .
I couldn’t get the value I passed in code.gs or “downloadthefile()”.
Would you help me please?
Thank you!

Html

<form id="downloadpdf">
  <input id="urlclass" type="text" name="urlname[]"  />
  <input type="submit" value="Download" />
</form>

Javascript

<script>
var urllink=[];                                      // Global variable a return from another function
$(document).ready(function() {
 function another(){
var url=[];
  url[0]=”www.abc.com”;
  url[1]=”www.abcd.com”;
  url[2]=”www.abcde.com”;
  urllink.push(url);                                    // Assigning the global array value by the urls
}
$("#downloadpdf").submit(function() {
$("#urlclass").val(urllink);                     // assigning the input value by the Global array value.
google.script.run.withSuccessHandler(function(retsearch){
}).downloadthefile(this);
});
});
</script>

Code.gs

function downloadthefile(urlpass){
Logger.log(urlpass.urlname);                                  // I couldn't get the urls here
}

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273