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

Re: control name as variable by David

David
Tue Nov 07 10:19:55 CST 2006

Did you define the variable first? Ex:

var variable = 'X';

Can you give us a little more information about what you're trying to do?
Are you trying to reference an object on a form? Ex:

document.FORMNAME.FIELDNAME.value

Where you have disable = true. are you trying to disable a field or button
on a form? Ex:

document.FORMNAME.OBJECTNAME.disabled= true or
document.FORMNAME.OBJECTNAME.readOnly = true

Please provide more information



"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
>



Re: control name as variable by led

led
Tue Nov 07 10:47:44 CST 2006

yes i try to work on a field in a form and the object name is passed in a
procedure parameter..
"David Berry" <dberry@mvps.org> escreveu na mensagem
news:%23fxFNioAHHA.5060@TK2MSFTNGP02.phx.gbl...
> Did you define the variable first? Ex:
>
> var variable = 'X';
>
> Can you give us a little more information about what you're trying to do?
> Are you trying to reference an object on a form? Ex:
>
> document.FORMNAME.FIELDNAME.value
>
> Where you have disable = true. are you trying to disable a field or button
> on a form? Ex:
>
> document.FORMNAME.OBJECTNAME.disabled= true or
> document.FORMNAME.OBJECTNAME.readOnly = true
>
> Please provide more information
>
>
>
> "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
>>
>
>



Re: control name as variable by David

David
Tue Nov 07 10:53:50 CST 2006

How are you passing the name of the object? What's the whole code or a URL
where we can see this?


"led" <tabemta@tabemta.com> wrote in message
news:%23XciyxoAHHA.4060@TK2MSFTNGP03.phx.gbl...
> yes i try to work on a field in a form and the object name is passed in a
> procedure parameter..
> "David Berry" <dberry@mvps.org> escreveu na mensagem
> news:%23fxFNioAHHA.5060@TK2MSFTNGP02.phx.gbl...
>> Did you define the variable first? Ex:
>>
>> var variable = 'X';
>>
>> Can you give us a little more information about what you're trying to do?
>> Are you trying to reference an object on a form? Ex:
>>
>> document.FORMNAME.FIELDNAME.value
>>
>> Where you have disable = true. are you trying to disable a field or
>> button on a form? Ex:
>>
>> document.FORMNAME.OBJECTNAME.disabled= true or
>> document.FORMNAME.OBJECTNAME.readOnly = true
>>
>> Please provide more information
>>
>>
>>
>> "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
>>>
>>
>>
>
>



Re: control name as variable by Jon

Jon
Tue Nov 07 10:54:52 CST 2006

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
>



Re: control name as variable by led

led
Tue Nov 07 11:07:15 CST 2006



www.sulferias.com/uploadscript2.asp
"David Berry" <dberry@mvps.org> escreveu na mensagem
news:ONC8J1oAHHA.4844@TK2MSFTNGP02.phx.gbl...
> How are you passing the name of the object? What's the whole code or a
> URL where we can see this?
>
>
> "led" <tabemta@tabemta.com> wrote in message
> news:%23XciyxoAHHA.4060@TK2MSFTNGP03.phx.gbl...
>> yes i try to work on a field in a form and the object name is passed in a
>> procedure parameter..
>> "David Berry" <dberry@mvps.org> escreveu na mensagem
>> news:%23fxFNioAHHA.5060@TK2MSFTNGP02.phx.gbl...
>>> Did you define the variable first? Ex:
>>>
>>> var variable = 'X';
>>>
>>> Can you give us a little more information about what you're trying to
>>> do? Are you trying to reference an object on a form? Ex:
>>>
>>> document.FORMNAME.FIELDNAME.value
>>>
>>> Where you have disable = true. are you trying to disable a field or
>>> button on a form? Ex:
>>>
>>> document.FORMNAME.OBJECTNAME.disabled= true or
>>> document.FORMNAME.OBJECTNAME.readOnly = true
>>>
>>> Please provide more information
>>>
>>>
>>>
>>> "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
>>>>
>>>
>>>
>>
>>
>
>



Re: control name as variable by led

led
Tue Nov 07 11:35:41 CST 2006

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
>>
>
>



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
>>>
>>
>>
>
>