Jump to content

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

Recommended Posts

Posted

I have a rather long list of values that I am going to set up as radio buttons. Is there a way to display these in two columns (taking up less screen space) than in one long column?

Thanks.

Version: v6.x

Platform: Windows 2000

Posted

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

Posted

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

Posted

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

Posted

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

This topic is 7615 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
×
×
  • Create New...

Important Information

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