struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heidy Gutiérrez Guzmán" <heidyg...@gmail.com>
Subject put value to an html:hidden field from a java script function
Date Thu, 21 Sep 2006 13:02:00 GMT
Hi

I need to put value to an input hidden field, from a java script function.
I call the java script function from an onclick event of html:submit field
I have debuged that process and input hidden field does'nt take value.
Always have the default value.

This is my way to do this


*******This is the java script function*********
<script language="JavaScript">

   function actualizarCampoOcultoRest(forma, campo, valor)

   {

    document.forma.campo.value = valor;

  }

 </script>



**********This is the call to the function java script********************

<html:submit styleClass="botones" property="btnEdicion"
onclick="actualizarCampoOcultoRest(gestionarListadoMonitoresEDHEPForm,
campoOcultoRestablecer, '1');">

     <logic:present name="idSeleccionado" scope="session"><bean:message key=
"boton.Actualizar"/></logic:present>

     <logic:notPresent name="idSeleccionado" scope="session"><bean:message
key="boton.Insertar"/></logic:notPresent>

</html:submit>

*********This is the input field***********

<html:hidden property="campoOcultoRestablecer"/>

*******In the ActionForm class i declared the input field like
this:****** private
int campoOcultoRestablecer;

Always have the default value, 0

if anybody could help me...

Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message