Bienvenido, Invitado
Recordarme

TEMA:

Add an 'other' option to Select From List field that requires text entry 6 meses 3 semanas antes #265481

  • Autor del tema
  • Gillian
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 126
  • Karma: 2
  • Gracias recibidas: 0
I have a 'Select From List' field giving specific times in half-hour slots.
I would like to add an 'other' option that if selected, opens a new field that requires the submitter to input a specific time that is not in the current list.

Is this possible?

TIA

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Add an 'other' option to Select From List field that requires text entry 6 meses 3 semanas antes #265486

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2498
  • Karma: 2
  • Gracias recibidas: 135
Hi,

yes, it is possible, you can do it!
I created one example for you, as same as you wanted!
Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).

Please go to Advanced of your form and insert this code :
 turn on element mydummy if yourdummy is something

Then in Advanced of an element, and I action script select type 'Custom' and Action 'Changes', insert this code:
function ff_nameofelement_action(element, action)
{
    switch (action) {
        case 'change':
opts = element.options;
var selected = element.value;
var t = ff_getElementByName('nameoftextfield').value;
if(selected == "other"){
bfToggleFields('on','element','nameoftextfield',bfDeactivateField);

}else{
bfToggleFields('off','element','nameoftextfield',bfDeactivateField);
 ff_getElementByName('nameoftextfield').value="";
}
            break;
        default:;
    } // switch
} // ff_select_action

Then go to on textelement, and in Advanced element of the element, turn off element and in section action script select type 'Custom' and Action 'Changes', and insert this code:
function ff_nameoftextelement_action(element, action)
{
    switch (action) {
        case 'change':
opts=ff_getElementByName('nameofselectlist').options;
var t=element.value;
for (i=0; opts.length; i++ ){
if(opts[i].value == t){
element.value="Insert a new value";//insert text which will be displayed when user insert same value as of list
}
}

            break;
        default:;
    } // switch
} // ff_a_action

I hope I explained it well, if you need more help, let me know!

Regards,
Mirko
Adjuntos:

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Add an 'other' option to Select From List field that requires text entry 6 meses 3 semanas antes #265489

  • Autor del tema
  • Gillian
  • Fuera de línea
  • Senior Breezer
  • Senior Breezer
  • Mensajes: 126
  • Karma: 2
  • Gracias recibidas: 0
Thank you. I'll have a go tomorrow, but unfortunately I have 18 of these fields to modify!

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by Gillian.

Add an 'other' option to Select From List field that requires text entry 6 meses 3 semanas antes #265490

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2498
  • Karma: 2
  • Gracias recibidas: 135
Hi,

ok, let me know result!

you can test my solution, and if ok, I can adjust all 18 fields for you!

Let me know!
Regards,
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
Moderadores: ForumSupport
Tiempo de carga de la página: 0.035 segundos