Excelent, this is what I was looking for.

onSuccess in Ajax.request will have something like this:

tipodoc.innerHTML =
          tdocuselect.childElements()[tdocuselect.selectedIndex].innerHTML +
addHidden('tdocu',tdocuselect.value);

where addHidden is this:

function addHidden(variable,valor){
   var salida = '<INPUT type="hidden" name="' + variable + '" value="' +
      valor + '"';
   return salida;
}

Thanks.

2009/7/6 Alexander Wallace <alexmlwall...@gmail.com>:
> You should be able to do something along the lines of:
> var select_menu = $("tdocu");
> var description =
> select_menu.childElements()[select_menu.selectedIndex].innerHTML;
> - Alex
>
> 2009/7/6 Martín Marqués <martin.marq...@gmail.com>
>>
>> I have a select pull down within a form that at submition executes
>> some ajax stuff and updates the div where the <SELECT> tag lives. HTML
>> code is like this (I'm using HTML_Template_IT from PHP, so the
>> BEGIN-END define a block, and {} define replacable text):
>>
>>      <td class="titulo">Tipo de documento:</td>
>>      <td>
>>        <div id="tipodoc">
>>          <SELECT id="tdocu" name="tdocu">
>>            <!-- BEGIN option -->
>>            <OPTION value="{VALOR}">{DESC}</option>
>>            <!-- END option -->
>>          </SELECT>
>>        </div>
>>      </td>
>>
>> What I want is, on submit to take the description that is shown in the
>> HTML page, not the value. How do I do that?
>>
>> --
>> Martín Marqués
>> select 'martin.marques' || '@' || 'gmail.com'
>> DBA, Programador, Administrador
>>
>>
>
>
> >
>



-- 
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to