Spacing between radio-buttons

PennController for IBEX Forums Support Spacing between radio-buttons

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9756
    rsim
    Participant

    Hi Jeremy!

    I have an issue with the spacing between two radio buttons.
    I would like to have two radio buttons and to have sentences that follow each of those radio buttons like below:
    (For instance, ‘o’ represent button.) ———>         o sentence 1    o sentence 2

    As sentences are long, some part of the sentence 1 or the sentence 2, for instance, show up in the next line.
    Is there anyway that I can keep those two sentences in one line?

    The following is the code that I used:

    newScale("practice_response", sentence1, sentence2)
                .radio()
                .log()
                .labelsPosition("right")
                .center()
                .print()
                .wait()
            ,

    Thank you very much for your help!

    Best,
    Rok

    • This topic was modified 1 year, 3 months ago by rsim.
    #9760
    Jeremy
    Keymaster

    Hi Rok,

    You can keep the two sentences on a single line, but if they are too long, they will necessarily end up overflowing the page’s width at some point:

    newScale("practice_response",
        "<span style='white-space: nowrap;'>this is a first pretty darn long sentence if you want my opinion</span>", 
        "<span style='white-space: nowrap;'>this is a second rather wordy sentence too if we are being honest</span>")
        .radio()
        .log()
        .labelsPosition("right")
        .center()
        .print()
        .wait()

    Jeremy

    #9761
    rsim
    Participant

    Hi Jeremy,
    Thank you for a quick reply.
    Actually, sentence 1 and sentence 2 have to be pulled up from .csv file, which means they are not constant but should change by rows.

    I tried with your code, and it gives me ‘o row.r1 o row.r2’ as an output. (o represent radio button.)

    newScale("practice_response", "<span style='white-space: nowrap;'>row.r1</span>", "<span style='white-space: nowrap;'>row.r2</span>")
                .radio()
                .log()
                .labelsPosition("right")
                .center()
                .print()
                .wait()
            ,

    Could you please help me on this again?

    Thank you!

    Best,
    Rok

    #9765
    Jeremy
    Keymaster

    Hi Rok,

    You cannot simply insert row.r1 and row.r2 directly in a string and have them replaced with the values of the corresponding javascript expressions. You need to do:

    newScale("practice_response", 
      "<span style='white-space: nowrap;'>"+row.r1+"</span>",
      "<span style='white-space: nowrap;'>"+row.r2+"</span>")

    Jeremy

    #9769
    rsim
    Participant

    Hi Jeremy,

    Wonderful! This works now.

    Thank you so much for this, Jeremy.

    Rok

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.