dropdown and hidden filed

soldorado 03 Feb, 2010
hi

how i can show a field with a specific choise ?

when a member choose the "other" in dropdown i would show a text field "other" .
how i can it ?
GreyHead 03 Feb, 2010
Hi soldorado,

You need to use JavaScript to detect that the 'Other' option is selected and then to enable or display the text input. Here'sa a snippet that will check a select with id='hearabout' and change the state of a text input with id='other'
window.addEvent('domready', function() {
  $('hearabout').addEvent('change', function() {
    if ($('hearabout').value == 'Other' ) {
      $('other').disabled = false;
    } else {
      $('other').disabled = true;
    }
  });
  $('other').disabled = true;
});

Bob
This topic is locked and no more replies can be posted.