CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Español

 Valor del listbox en javascript client-side por favor!

Print topic Send  topic

Author Message
cHUCk
Posted: 06/20/2006, 1:41 AM

Hola a todos, primer vez k posteo en espanol, necesito su ayuda para referenciar del lado del cliente (Javascript) el valor actual de un listbox, la funcion es evento->listbox_change

estoy usando algo asi

var mivar=document.forms["miformulario"].milistbox.value;

Esto me devuelve un 'undefined' como valor... como obtener el valor actual del listbox por favor?

gracias!

cHUCk
lvalverdeb

Posts: 299
Posted: 06/20/2006, 6:47 AM

Chuck,

Prueba con:

var mivar = document.forms["miformulario"].milistbox.selectedIndex;
valor = document.forms["miformulario"].milistbox.options[selectedIndex].value;

Luis



_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4
View profile  Send private message
Hidran
Posted: 06/20/2006, 6:50 AM

Puedes ponerlo asì:
var listbox=document.forms["miformulario"].milistbox;
var mivar=listbox.options[listbox.selectedIndex].value;
O le pones un id a la listbox y haces asì:
var listbox=document.getElementById("idlistbox");
var mivar=listbox.options[listbox.selectedIndex].value;

Hidran
"cHUCk" <cHUCk@forum.codecharge> ha scritto nel messaggio
news:304497b4c11b644@news.codecharge.com...
> Hola a todos, primer vez k posteo en espanol, necesito su ayuda para
> referenciar
> del lado del cliente (Javascript) el valor actual de un listbox, la
> funcion es
> evento->listbox_change
>
> estoy usando algo asi
>
> var mivar=document.forms["miformulario"].milistbox.value;
>
> Esto me devuelve un 'undefined' como valor... como obtener el valor actual
> del
> listbox por favor?
>
> gracias!
>
> cHUCk
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.