It seems like you're working against the standard here. Normally, the value
is what's important upon submission.
But what you want can be done. There are two approaches to this:

1. When rendering the page, make the value and description the same. You'll
need to escape the value attribute with html entities to ensure it's read
properly. You'll end up with HTML that looks like this:

<select id="tdocu" name="tdocu">
    <option value="Me &amp; Friends">Me &amp; Friends</option>

This approach is nice because it helps ensure that your page works when
Javascript is disabled or unavailable.

2. Alter the value with javascript before posting. That would look something
like this (untested):

$('myform').observe('submit', function(event)
    var selectInput = $('tdocu');
    var value = selectInput.value;
    selectInput.value ='option[value="' + value +


2009/7/6 Martín Marqués <>

> 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' || '@' || ''
> DBA, Programador, Administrador
> >

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to