You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Srilatha Salla <sa...@yahoo.com> on 2005/04/13 18:02:16 UTC

disable a text field.

Hi,
 
I have a dropdownlist. When I select "fixedwidth" option I have to make the textfield mapSet.delimiter noneditable/readonly, if I select "delimiter" option I should be able to enter data. I wrote an onchange event but I cannot make the textfield readonly. How do I change the attribute readonly to true/false on selection of an option dynamically.
 
<TD align=right><STRONG><bean:message key="label.fileformat" bundle="mappingResources"/>:</STRONG></TD>
                <TD><STRONG> <html:select property="fileFormat" onchange="makeNonEditable(this.value)">
                    <html:option value="">--Select One--</html:option>
                     <html:options name="fileFormatType" labelName="fileFormatType" />
                    </html:select></STRONG></TD>
 
 
<html:text property="mapSet.delimiter" name="mapSetForm"/>
 
 
function makeNobEditable(value) {
if(value=="Fixed Width") {
document.forms[0].elements['mapSet.delimiter'].readonly=true;
}
}
 
Thanks


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com