How to use multiple arguments in Google App Script function and check what radio box is checked across HTMLService?
<p>HTML Page:</p>

<pre><code>  &lt;html&gt;
      &lt;body&gt;
    &lt;div id="addGamePrompt"&gt;
    &lt;form&gt;
    First Pick Team: 
    &lt;div id="containerT1"&gt;&lt;input type="text" id="team1" name="team1"&gt; My Team &lt;input type="radio" name="myTeam" value="team1" id="checkTeam1" checked&gt;&lt;/div&gt;
    &lt;br&gt;&lt;br&gt;
    Second Pick Team: 
    &lt;div id="containerT2"&gt;&lt;input type="text"id="team2" name="team2"&gt; My Team &lt;input type="radio" name="myTeam" value="team2" id="checkTeam2"&gt;
    &lt;br&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;/div&gt;

    &lt;input id="submitBut" type="button" onClick="formSubmit()" value="Ok"/&gt;
    &lt;script type="text/javascript"&gt;

        function formSubmit() {
        google.script.run.getTeams(document.forms[0], 1);
        }

    &lt;/script&gt;

  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Google App Script</p>

<pre><code>function myFunction() {
     // Display a modal dialog box with custom HtmlService content.
     var htmlOutput = HtmlService
         .createHtmlOutputFromFile('addGamePrompt.html')
         .setWidth(300)
         .setHeight(130);
     SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Enter Teams');

    }
    function getTeams(form,flag1){
      var arg1 = arguments[0]; //form argument value
      var arg2 = arguments[1]; //flag1 argument value
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var team1 = arg1.team1; //gets value of form in HTML page
      var team2 = arg1.team2; //see above
      var flagCheck = arg2; //sets flagCheck as whatever argument flag1 is
      ss.toast(team1); //prints out in box the value of team1
    }
</code></pre>

<p>I want to be able to pass the value of the text boxes, and check which radio box is checked through the google app script (if the first one is flag1=1 if the second one is flag1 =2), but nothing is happening.</p>

<p>NOTE: Using this in Google Sheets.</p>