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>
</select>

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 = selectInput.select('option[value="' + value +
"']')[0].innerHTML;
});

--
Hector


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
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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