Skip to Content
author's profile photo Former Member
Former Member

Enable and disable field with checkbox field

Hi all,

I need to disable and enable field with checkbox field.

Help me please.

Follows attached image.

Thanks and Regards

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 07, 2013 at 03:04 PM

    bind enable property of input field with attrbute of type wdy_boolean change this attribute value on event On_toggle

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Linking to a wdy_boolean context variable is the best way to go as Jitendra suggested. However, I don't think OnToggle is appropriate. Once it is toggled off and the field is disabled, you can't toggle it again.

      Changing the flag that enables or disables the checkbox can be done in the WdDoModifyView (or in the post- method of this method in case you are enhancing a standard WDA application).

      So, you will have two flag variables: a flag that contains the actual value of the checkbox and a flag that contains whether the checkbox should be enabled/disabled.

  • Posted on Mar 07, 2013 at 03:30 PM

    Hi,

    As suggested the best way is bind the property Enabled with an attibute in the context.

    But I think the easiest way to do it is bind the property Enabled directly with the same attribute you use for your check box. Create an action for event onToggle but is not necessary to put any code there... is only for trigger the event...

    I prefer to use the property "Read Only" instead of "Enabled", looks better, you can do it binding the property "Read Only" with the inverse of the value of the attribute of your checkbox.

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

    • Now I get your point, but is not necessary to bind the variable L_FLAG to the property Enabled of the checkbox, you need to bind it with the property enabled of the INPUT FIELD.

      Although as I said I prefer to use the property Read Only of the Input field with the inverse of the attribute bound with the checkbox. (L_FLAG in this case)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.