• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Radio Group Formatting or two radio groups

Radio Group Formatting or two radio groups 15 years 6 months ago #8590

I have a large radio group, that is too long to display vertically, and is very hard to read when displayed horizontally.

Is there any way to format a single radio group into two columns?

Another thought is that I could use two radio groups, but could only allow one selection—if a selection from radio group "A" is made, it would not allow a selection from radio group "B", and vice-versa.

I read the FAQ on custom scripting, maybe something can be done with the javascript comparison for text fields (applied to the radio groups). But not a pro with javascript by any means.

Any assistance is appreciated.
The administrator has disabled public write access.

Re:Radio Group Formatting or two radio groups 15 years 6 months ago #8593

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can try arranging the radio group field into two radio group fields and you can try placing a script similar to this one in the Form Layout tab:
<script type=text/javascript>
function Radio1()
{
for(i=0;i<document.getElementsByName('form[radio1]').length;i++)
if(document.getElementsByName('form[radio1]')[i].checked)
for(j=0;j<document.getElementsByName('form[radio2]').length;j++)
document.getElementsByName('form[radio2]')[j].checked=false;
}
 
function Radio2()
{
for(i=0;i<document.getElementsByName('form[radio2]').length;i++)
if(document.getElementsByName('form[radio2]')[i].checked)
for(j=0;j<document.getElementsByName('form[radio1]').length;j++)
document.getElementsByName('form[radio1]')[j].checked=false;
}
</script>

The radio group fields from the script are "radio1" and "radio2" and the two functions are "Radio1" and "Radio2". You will have to change the names of the two fields with the names of the fields from your form. Also you will have to place this code line in the Additional Attributes box of the radio group field named "radio1":

onclick="Radio1();"

And you will have to place this code line in the Additional Attributes box of the radio group field named "radio2":

onclick="Radio2();"

The script will trigger the Radio1 function when a value from the "radio1" field is checked and it will uncheck all the options from the field "radio2". Also when a value from "radio2" is checked the function Radio2 will be triggered and it will uncheck all the values from the field "radio1".
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!