struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean, Michael" <>
Subject RE: How to make a SELECT list readonly? If set disabled, loses the value when submit.
Date Thu, 02 Nov 2006 16:19:25 GMT

This is slightly tangential...but I faced a similar problem in trying to
prevent "double-submit"...

Below is the solution jsp code...refer embedded comments...

      <html:submit styleId="saveBtn" styleClass="hiddenItem"
tabindex="100" value = "Save" />

  <!--in order to selectively disable both submit buttons(prevent the
dreaded double submit), I moved the parameters/arguments required by the
Struts DispatchAction sub-class to hidden fields. These are then
disabled/enabled, in tandem with the actual buttons, depending on the
particular action - Refer AdvancedFilters.js -->

  <input id="saveProxy" type="hidden" name="method" value="Save"/>

The narrative: when the user selects the submit button, the onsubmit()
method (defined in some external javascript) disables the button and
enables a proxy hidden field which also ha a VALUE argument which
matches the method name required by the DispatchAction sub-class...


-----Original Message-----
From: Mississippi John Hurt [] 
Sent: Wednesday, November 01, 2006 12:18 PM
To: Struts Users Mailing List
Subject: How to make a SELECT list readonly? If set disabled, loses the
value when submit.

Help, I can make <html:text> readonly by setting readonly="true" which
<html:select> has no readonly attribute, only a disabled. If I use
attribute, then the value of the select is no longer recognized and my
validation says its required.  How can I make the <html:select> disabled
readonly while keeping the values it has passing back to the action when
form is submitted. Thanks.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message