What you are suggesting will only work if the form is submitted after the checkbox is checked - probably not what you or the user would expect to happen.
I'd try and use JavaScript to achieve the same functionality on the client - the relevant event on the checkbox field could modify the disabled flag of the text input. Paul > -----Original Message----- > From: Daffin, Miles (Company IT) > [mailto:[EMAIL PROTECTED] > Sent: 19 November 2004 16:20 > To: [EMAIL PROTECTED] > Subject: Conditionally disable form input. > > > Hi All, > > I want to disable a text input if a certain checkbox input has been > checked (meaning, in the following example, that the name > input need not > be filled in). My jsp code looks like this: > > <html:text > property="<%=Keys.APPLICANT_FULLNAME_CHINESE%>" > size="100" > > disabled='<%=anExpressionThatDeterminesIfTheCheckboxHasBeenChe > cked()%>'/ > > > > I an using a DynaActionForm as my form bean. Ideally I suppose I would > use an expression like: > > formBean.get(otherFieldName) != null > > Has anyone done something like this? > > Many thanks. > > -Miles > > Miles Daffin > Morgan Stanley > 20 Cabot Square | Canary Wharf | London E14 4QA | UK > Tel: +44 (0) 20 767 75119 > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > -------------------------------------------------------- > > NOTICE: If received in error, please destroy and notify > sender. Sender does not waive confidentiality or privilege, > and use is prohibited. > > Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]