radio

Fix for Fix for Code

  1. <?php
  2.  
  3. function test_menu() {
  4.  
  5.   $items['test1'] = array(
  6.  
  7.     'title'             => 'test1',
  8.  
  9.     'page callback'     => 'drupal_get_form',
  10.  
  11.     'page arguments'    => array('test_1_form')

Fix for Fix for Code

  1. <?php
  2. function test_menu() {
  3.   $items['test1'] = array(
  4.     'title'             => 'test1',
  5.     'page callback'     => 'drupal_get_form',
  6.     'page arguments'    => array('test_1_form'),
  7.     'ty

Fix for Code

  1. <?php
  2.  
  3. function test_menu() {
  4.  
  5.   $items['test1'] = array(
  6.  
  7.     'title'             => 'test1',
  8.  
  9.     'page callback'     => 'drupal_get_form',
  10.  
  11.     'page arguments'    => array('test_1_form')

Code

  1. <?php
  2.  
  3. function test_menu() {
  4.  
  5.   $items['test1'] = array(
  6.  
  7.     'title'             => 'test1',
  8.  
  9.     'page callback'     => 'drupal_get_form',
  10.  
  11.     'page arguments'    => array('test_1_form')

Fix for would like to apply specific formatting to radio buttons

  1. $form['NameAddressQSet']['AddressQ'] = array(
  2.   '#type' => 'radios',
  3.   '#title' => t('Have you changed your address since the last time you registered?'),

Fix for would like to apply specific formatting to radio buttons

  1. Trying to do the following on a form :
  2.  
  3.                   This is a label:   __Text Field 1___    __Text Field 2___    __Text Field 3___
  4.             This is a radio label:  <x> Yes  < > No
  5.       This is another radio label:   < > Yes  <x> No
  6.  
  7. so the labels line up flush right and the fields flush left.  The approach I have taken with the text fields works well - wrap the text fields in a <div> using a separate field element (could have used prefix on the first field and suffix on the last - but same difference) and then using CSS to control the div.  Can not seem to figure out how to do this with the radio buttons however - the following issues arise:
  8.  
  9. - Radios treat the label and each of the buttons as three separate elements.  So I can not figure out how to "group" the buttons by themselves so I can apply the CSS.
  10. - Using Radio I have had lots of issues like - how to give each radio the same name so they behave correctly as a set of "or" buttons and do not see how to apply "checked" attribute etc.
  11.  
  12. Here's the form declaration -
  13.  
  14.                 $form['NameAddressQSet']['AddressQ'] = array(
  15.                 '#type' => 'radios',
  16.                 '#title' => t('Have you changed your address since the last time you registered?'),
  17.                 '#options' => array('yes' => t('Yes'), 'no' => t('No')),
  18.                 '#attributes' => array('onClick' => 'CheckState()'),
  19.                 '#default_value' => ( isset($node->ChangedAddress) && ($node->ChangedAddress == 'yes') ) ? 1 : 0,
  20.                 );
  21.  
  22. Thanks,
  23.  
  24. drob

would like to apply specific formatting to radio buttons

  1. Trying to do the following on a form :
  2.  
  3.                   This is a label:   __Text Field 1___    __Text Field 2___    __Text Field 3___
  4.             This is a radio label:  <x> Yes  < > No
  5.       This is another radio label:   < > Yes  <x> No
  6.  
  7. so the labels line up flush right and the fields flush left.  The approach I have taken with the text fields works well - wrap the text fields in a <div> using a separate field element (could have used prefix on the first field and suffix on the last - but same difference) and then using CSS to control the div.  Can not seem to figure out how to do this with the radio buttons however - the following issues arise:
  8.  
  9. - Radios treat the label and each of the buttons as three separate elements.  So I can not figure out how to "group" the buttons by themselves so I can apply the CSS.
  10. - Using Radio I have had lots of issues like - how to give each radio the same name so they behave correctly as a set of "or" buttons and do not see how to apply "checked" attribute etc.
  11.  
  12. Thanks,
  13.  
  14. drob
Syndicate content