Re: control name as variable by David
David
Tue Nov 07 12:12:43 CST 2006
You mean with ASP? Either
var VariableName = <%=VariableName%>;
document.forms['YourForm'].elements[VariableName].disabled=true;
Or
document.forms['YourForm'].elements[<%=VariableName%>].disabled=true;
In either case, somewhere on the page you have to define what's being held
in VariableName or the value will be blank. Ex:
<%
VariableName = Request.Form("FieldName")
%>
"led" <tabemta@tabemta.com> wrote in message
news:u1$rlMpAHHA.4680@TK2MSFTNGP04.phx.gbl...
> and in vbscript
>
>
>
> "Jon Spivey" <jon@NotThis-Nisusnewmedia.com> escreveu na mensagem
> news:OulU01oAHHA.3396@TK2MSFTNGP02.phx.gbl...
>> Not like that, like this
>>
>> document.forms['YourForm'].elements[VariableName].disabled=true;
>>
>> Cheers,
>> Jon
>>
>> "led" <tabemta@tabemta.com> wrote in message
>> news:%23ucpBUoAHHA.4472@TK2MSFTNGP03.phx.gbl...
>>> window.document.fp1.variable.disabled=true
>>>
>>> it is possible to write the name of a form control using a variable in a
>>> expressio like that???
>>>
>>> thanks
>>>
>>
>>
>
>