Jump to content

Radio Buttons in Columns


 Share

This topic is 6510 days old. Please don't post here. Open a new topic instead.

Recommended Posts

You will need to use a little bit of Javascript for this:

<table><tr>



<script>i = 1 ; nCols = 3 ;[FMP-Record]



if ((i % nCols) == 0)



        { document.write("<td>[FMP-Field:name]</td></tr><tr>") ; }



else



        { document.write("<td>[FMP-Field:name]</td>") ; } ;



i++ ;[/FMP-Record]



</script></tr></table>

This example is for three colums.

Hope this helps.

Garry

Link to comment
Share on other sites

Okay, Garry, remember you're dealing with a program illiterate here.

Sample question: Field Name--HiDegree

What is the highest degree you have earned?

Response options:

B.A.

B.S.

M.A.

M.S.

J.D.

Ph.D.

M.D.

<table><tr><script>i = 1 ; nCols = 3 ;

[FMP-Record]if ((i % nCols) == 0) { document.write("<td>

[FMP-Field:HiDegree]</td></tr><tr>") ; }

else { document.write("<td>

[FMP-Field:HiDegree]</td>") ; } ;i++ ;

[/FMP-Record]</script></tr></table>

I think I missed something in the translatin again. Surprise!! laugh.gif

Link to comment
Share on other sites

Give this one a go smile.gif

<table><tr>

<script>i = 1; nCols = 3;

[FMP-ValueList: HiDegree, List=Degrees]

if ((i % nCols) == 0)

	{ document.write('<td><input type="radio" name="HiDegree" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem]</td></tr><tr>');}

else

	{ document.write('<td><input type="radio" name="HiDegree" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem]</td>');};

i++;

[/FMP-ValueList]

</script></tr></table>

Good Luck.

Garry

Link to comment
Share on other sites

Hi, E.D.! Using the ValueList is generally better so you don't have to change your web stuff if anything changes, but since your degrees list does not look like it would change much, you can also just hard code the radio buttons in a table if you like with any number of columns/rows you like. Make sure every button has the same name as the field but with different values and don't use the FMP-ValueList option at all. (Although Garry's JavaScript is awesome and I'm gonna copy/paste it into my code db... Thanx, GL!)

--ST

Link to comment
Share on other sites

This topic is 6510 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.