struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laredotornado <laredotorn...@gmail.com>
Subject How do I create a conditionally disabled button?
Date Thu, 28 Aug 2008 17:20:49 GMT

Hi,

I'm using Struts 1.  I'm trying to clean up some code and make it into a
proper Struts form.  How do I create a button whose disabled attribute is
set to true or false depending on a certain condition on my page?  (The
condition is if the variable "endCount" is less than the variable
"maxCount")

Right now I have


                                <%
                                }
                                if(endCount<maxCount) {
                                %>
                                <td align="center">
                                        <form name="Next"
action="<%=request.getContextPath()%>/manageUsers.do"">
                                                <input type="submit"
name="next" value="<bean:message key="button.next"/>">
                                        </form>
                                </td>
                                <%
                                } else {
                                %>
                                <td align="center">
                                        <form name="Next"
action="<%=request.getContextPath()%>/manageUsers.do"">
                                                <input type="submit"
name="next" disabled="disabled" value="<bean:message key="button.next"/>">
                                        </form>
                                </td>
                                <%
                                }
                                %>

Thanks, - Dave
-- 
View this message in context: http://www.nabble.com/How-do-I-create-a-conditionally-disabled-button--tp19205159p19205159.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message