Hello, You should try something like this :
<td align="center"> <form name="Next" action="<%=request.getContextPath()%>/manageUsers.do""> <input type="submit" name="next" disabled="<%= String d = (endCount<maxCount) ? "false" : "true"; %>" value="<bean:message key="button.next"/>"> </form> </td> I haven't try it myself but this is the idea. Moreover, you should replace : action="<%=request.getContextPath()%>/manageUsers.do""> with action="/manageUsers.do""> : I don't think you need the context path. My memories from Struts 1 are a bit old, but it should give you a nice starter. HTH, Pierre On Thu, Aug 28, 2008 at 7:20 PM, laredotornado <[EMAIL PROTECTED]>wrote: > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >