Thks for you answer but is still open Because I need to put into the textfield base in another property of Maquina object (here only put id), for example: name or comment, features, ect.
So every time a select a Maquina object, I need to get also the properties of its. Domingo A. Rodriguez S. wrote: > > Hello Victor, > > Simplify. something like this should work. > > Maquina.onChange event > { > document.form1.textfield1.value= > document.form1.Maquina.options[document.form1.Maquina.selectedIndex].value; > } > > Regards, > Domingo > > --- victor sosa <[EMAIL PROTECTED]> escribió: > >> >> ANY IDEAS, how to? >> >> >> victor sosa wrote: >> > >> > Hi, I am trying to update a textfield when the select is changed using >> > javascript event onchange, so How I can do that? Which is the best >> > practices here? >> > >> > >> > Here is my code, any Ideas? >> > >> > <script type="text/javascript"> >> > function getVolumenInicial() { >> > var volumenInicial = >> document.getElementById('save_volumenInicial'); >> > var maquinaSelected = >> document.getElementById('save_maquina_codigo'); >> > volumenInicial.value = '%{maquinas[' + >> maquinaSelected.selectedIndex + >> > '].metro}'; >> > } >> > </script> >> > ..... >> > <s:select label="Maquina" name="maquina.codigo" list="maquinas" >> > onchange="getVolumenInicial();" >> > value="%{maquina.codigo}" required="true" >> > listKey="codigo" >> > listValue="codigo" /> >> > >> > <s:textfield label="Volumen Inicial" name="volumenInicial" >> > value="%{venta.volumenInicial}" readonly="true" size="7" >> maxlength="9" >> > /> >> > >> > ANY IDEAS, how to? >> > >> > >> >> -- >> View this message in context: >> > http://www.nabble.com/javascript-update-tag-value-property-tf4843331.html#a13858354 >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > Comparte video en la ventana de tus mensajes (y también tus fotos de > Flickr). Usa el nuevo Yahoo! Messenger versión Beta. > http://e1.beta.messenger.yahoo.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/javascript-update-tag-value-property-tf4843331.html#a13887504 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]