struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean, Michael" <Michael.D...@courts.wa.gov>
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
MJ,

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

HTH,
M



-----Original Message-----
From: Mississippi John Hurt [mailto:johnhurt@gmail.com] 
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
works.
<html:select> has no readonly attribute, only a disabled. If I use
disabled
attribute, then the value of the select is no longer recognized and my
form
validation says its required.  How can I make the <html:select> disabled
or
readonly while keeping the values it has passing back to the action when
form is submitted. Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message