PennController for IBEX › Forums › Support › Spacing between radio-buttons
- This topic has 4 replies, 2 voices, and was last updated 1 year, 10 months ago by rsim.
-
AuthorPosts
-
December 4, 2022 at 11:26 pm #9756rsimParticipant
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, 10 months ago by rsim.
December 4, 2022 at 11:39 pm #9760JeremyKeymasterHi 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
December 4, 2022 at 11:57 pm #9761rsimParticipantHi 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,
RokDecember 5, 2022 at 3:56 pm #9765JeremyKeymasterHi Rok,
You cannot simply insert
row.r1
androw.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
December 5, 2022 at 5:28 pm #9769rsimParticipantHi Jeremy,
Wonderful! This works now.
Thank you so much for this, Jeremy.
Rok
-
AuthorPosts
- You must be logged in to reply to this topic.