PDA

View Full Version : Prevent blank EditBox's on a dialogue?



slezberg
04-06-2002, 01:34 PM
Is there any way to prevent blanks on a dialogue in a EditBox? I know you can do an do a DoAction to call a CA to present a message but it still goes to next screen. How can I prevent that?

Event: DoAction
Argument: CheckDatabaseInformation
Condition: txtDatabaseServer = "" Or txtDatabaseUsername = "" Or txtDatabasePassword = ""

I have tried the above but it the CA always runs and goes to the next dialogue?

Thanks

Scott

Bloomerville
04-08-2002, 06:12 AM
Instead of a message box through an event, you can condition the Next Button to be enable or disable based upon the appropriate Edit boxes being blank or not. I would, however, make sure to add text to the page explaining that all info must be completed before the user can proceed. I have used this method before when I wanted to make sure a Serial Number and install code were entered. Hope this helps.

slezberg
04-08-2002, 11:45 AM
I tried setting the Condition on the Next button to:

Disable: txtDatabaseServer = ""
Enable: txtDatabaseServer <> ""

And it never becomes enabled.

What am I doing wrong?

Thanks in advance.

Scott

Bloomerville
04-08-2002, 01:01 PM
make sure that you are conditioning the property not the actual name of the edit box. in other words if you box is called NameEdit and the property is NAME. The conditions should be NAME="" OR NAME<>"". You also may need to refresh the property value, this is done on the behavior screen. select NameEdt(edit box) and under event place the following;

Event Argument Condtion
[NAME] [NAME] 1


This means when a user clicks or tabs into the edit box, the NAME property is refreshed. As a result your condition will be performed. I have tested this and it works. I also use this is other installs I have built.

slezberg
04-08-2002, 01:11 PM
Thanks...that worked great.

In another instance, I need to do is display an message like "Database Server is a required" so I created a custom action with VBScript and set the DoAction if that condition is met when the user clicks the Next button; however, it still goes to the next dialog. How can I have it abort or stay on the current dialogue when a condition is met and the user clicks Next? I tried a NewDialog event but got an error during runtime.

Thanks in advance.

Scott

Bloomerville
04-08-2002, 01:58 PM
If you wanted the user to have to exit after seeing the message then in your vb script set another property (for example ENDINSTALL). Set this to a value, such as Y. Then inbetween your DoAction event and the New Dialog event. Add the EndDialog Action with an Argument of Exit. The condition would be to go to the end dialog when ENDINSTALL= "Y". Also, add the condion to the NewDialog action (i.e. (current condition AND ENDINSTALL = "N". Therefore the install would not proceed to the new dialog until the current condition is met and ENDINSTALL = 'N'.

slezberg
04-09-2002, 08:28 AM
I dont want the user to exit or EndDialog to appear. I just want it to stay on the same dialog that the user is at so they can fill in the required field.

Any ideas?

Thanks

Scott

Bloomerville
04-09-2002, 08:48 AM
If the next button is disabled until the field is populated, then they have no choice but to stay on the same screen. I would add text to the title text section to state both fields are required. If you are using installscript, then you can call a message box with just an ok button. You will need to call this DoAction event from the field that is requried, not the next button. Possilbly may need to call of other field, because upon entry to the screen the value would be blank and the message box would appear prior to the user having a chance to actually enter text.

xingcheng
09-06-2002, 08:05 PM
I am trying to do the same thing. However I tried to add to behavior:

Event Argument Condition
[property] [property] 1

to the edit box behavior, but refreshing doesn't seem to happen. As a result, my "Next" button is always disabled, even though I type in text into the edit box.

Did I miss anything? I tried also to let the Next button subscribe to [Property] but IS doesn't allow it.

Also tried
Event Argument Condition
[property] property 1

but that only populates the text box with "property" and refresh still doesn't work.

I finally added
Event Argument Condition
[property] [property] 1

to Next button's behavior, still no good.

BTW, I am using IS Developer 7.04, could that make a difference?