realbasic-nug
[Top] [All Lists]

Enabling the OK Button on the Fly

To: REALbasic Discussion List <realbasic-nug at lists dot realsoftware dot com>
Subject: Enabling the OK Button on the Fly
From: Charles Kelley <ckelley at lrcm dot usuhs dot mil>
Date: Sun, 3 Oct 2004 18:11:15 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Hi, all!

I have designed a very long form in a dialog box for a membership database I'm developing. It consists of editfields for first name, middle name, last name, street address, city, state, ZIP (postal) code; various roles in the organization and various means of contact; popup menus for age group and affiliation type.*

The OK button should be disabled when all of the editfields are empty, all of the checkboxes are unchecked, and all of the popup menus are UNKNOWN; that is, when the form is blank, in layman's terms. That's easy when the form first appears: nothing is filled in, so the OK button begins disabled.

But a problem arises when the form is filled in because a field could be filled in and then cleared a short time later. The OK button ought to be disabled or enabled accordingly. In short, I'm trying to do this [in pseudocode]

                if dialogBox.FormBlank then
                        OKButton.enabled = FALSE
                else
                        OKButton.enabled = TRUE
                end if // is the form blank?

How do I achieve that? When I first began developing it in a THINK Pascal program a decade ago, I put the check in the idle event. But I don't see an event analogous in RB. Can anyone suggest where to put the check?

        Many thanks for your help.

        -- Charles.

Footnote

        * One of the values in every popup menu is UNKNOWN.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>