struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mark.l...@talk21.com>
Subject Re: disabling form element
Date Tue, 01 Jul 2003 10:01:23 GMT

//I prefer this way of drilling through the DOM.

But document.forms[0].remarks should be fine as well.

document.forms[0].elements['remarks'].disabled = true;

the onchange event doesn't require the javascript: i only use this when 
I'm calling functions from a href.

onchange="change()"


HTH mark


On Monday, Jun 30, 2003, at 22:39 Europe/London, Frances Aleah Z. de 
Guzman wrote:

> can anyone tell me how to disable a form element via javascript. i 
> have a
> combo box and i want to use the onchange event to disable a certain
> textbox...
>
> <nested:select property="paramType" onchange="javascript:change()">
>        <html:optionsCollection name="lookup" property="applications"/>
> </nested:select>
>
> the textbox is:
> <nested:text property="remarks" size="50" />
>
> the javascript:
> function change(){
>   document.forms[0].remarks.disabled=true;
> }
>
> is there anything wrong with my code?
> -- 
> Frances Aleah Z. De Guzman
> SA/Programmer
> Ingenium Technology, Inc.
> http://www.ingenium.com.ph
>
> Disclaimer :
> This message is intended only for the named recipient. If you are not 
> the
> intended recipient you are notified that disclosing, copying, 
> distributing
> or taking any action in reliance on the contents of this information is
> strictly prohibited.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Mime
View raw message