struts-user mailing list archives

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

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;



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

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

     <logic:present name="idSeleccionado" scope="session"><bean:message key=

     <logic:notPresent name="idSeleccionado" scope="session"><bean:message


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


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