Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6594817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:51:35+00:00 2026-05-25T17:51:35+00:00

I am working on scripts that would generate a list of radiobuttons. The user

  • 0

I am working on scripts that would generate a list of radiobuttons.
The user would have to choose one of the answer, and one cell is filled with the result.

The number of radiobuttons in not known at the beginning, and depends onthe number of contacts in a group of gmail contacts.

My question is pretty simple, how can I display as much radiobuttons as needed ?
I tried to put them in a loop, but it appears that nothing is loaded but my submit button.

function test(){
    var mydoc = SpreadsheetApp.getActiveSpreadsheet();
    var app = UiApp.createApplication().setTitle('Choose your contact'); 
    //to use radios you will need a form  
    var form = app.createFormPanel().setId('form').setEncoding('multipart/form-data');

    //Retrieving contacts in first speadsheet tag
    var sheet = mydoc.getSheets()[0];//select first sheet
    var tagName = sheet.getRange("G4").getValue();//where the tag is placed
    var length = count_contacts_in_tag(tagName)

    //initiates grid
    var formContent = app.createGrid().resize(length + 1,1);
    form.add(formContent);

    var group = ContactsApp.getContactGroup(tagName);
    var contacts = group.getContacts();
    **// TODO: My problem is here!**
    for (var i in length) {
        var myRadio1 = app.createRadioButton("radio", "one").setFormValue('one');
        formContent.setWidget(i, 0, myRadio1);
    }

    formContent.setWidget(length, 0, app.createSubmitButton('Submit!')); //submit button
    app.add(form);

    mydoc.show(app); 
}

Any hint would be grately appreciated !

Thanks by advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:51:36+00:00Added an answer on May 25, 2026 at 5:51 pm

    The answer is pretty straghtfoward, as long as you know where to search for the information. THe Google Scripts are a subset of JavaScript. My problem was simply coming from the structure of my loop.

    It should be : for (var i=0; i

    C U . . .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a site that still has a lot of scripts in ColdFusion.
I'm working on a Bash shell script that runs several Python scripts like so:
I need one that does not have a big queue. So, if it does
I am currently working on a random number generator script that will generate three
I have a working perl script that grabs the data I need and displays
I need to generate an SSH key pair that I'll be working with later
I need to code a PHP script that would let me generate a pdf
I have a list that is being fed in to my page using an
I am beginning python and working on a project, and one thing I would
I was working on a script that grabs the value from the selected option

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.