How to Enable/Disable a field with LotusScript

20 pts.
Tags:
CheckBox
Lotus development
Lotus Notes
LotusScript
i am trying to enable a field input using a lotus script.i want to enable the input to field as soon as i select a checkbox any body has a code for that?

Answer Wiki

Thanks. We'll let you know when a new response is added.

This is best done with hide formulas, not script. Set the properties of your checkbox field to “Refresh choices on document refresh”. Then, the line or table cell that contains the field that you want to disable can have a hide formula something like CheckboxField = “Yes”.

If you want to display the value of the disabled field even though your checkbox is disabling it, add a second line beneath the hidden field with another field, computed for display, with its value being that of the disabled field. The display field needs the opposite hide formula, i.e. CheckboxField != “Yes”.

I suggest using a table for formatting your fields and field descriptions, because your page can be much neater and your hide formulas can apply to individual cells rather than to whole lines.

Hope that helps.

Also, the InputEnabled event can be configured if the field uses an OS style. Seems to depend on the field datatype and other things, at least in r6.5, but it is worth looking into.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BruceWayne
    Yep You would add also this code in the exiting event of the checkbox :
    Dim ws as new NotesUIWorkSpace
    Dim uidoc as NotesUIDocument
    Set uidoc = ws.currentdocument
    Call uidoc.refresh
    
    With the refesh (or refreshhideformulas maybe it's enough) it will hide ou show the linked fields (according to your hide-when formulas)
    4,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following