FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Valid not getting evaluated after button click
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Valid not getting evaluated after button click
Posted: Wed Oct 15, 2008 11:10 AM
Hi friends,

I don't know where I have went wrong.

I am having a very strange problem. Valid is getting evaluated only once. After I click the button,the valid's are not getting triggered

I have 3 gets in the Dialog with valid statement !empty(cVar). Initially it works fine. But after I click the Save button, if I try to make the get's empty, the valid is not getting fired.

I am herewith pasting an example code

Pls note: The problem occurs only after clicking the save button

#include "FiveWin.ch"
*-----------------------------------------*
Function Main()
*-----------------------------------------*
Local oDlg, oBtnSave, oBtnCancel
Local cAcName:=spac(30), cAddr1:=space(50), cAddr2:=space(50)
Local aOGets:={nil,nil,nil}

DEFINE DIALOG oDlg TITLE "Add New Account Heads" from 1,1 to 19,80

@01  ,04 say "A/c Name *" OF oDlg RIGHT SIZE 45, 12
@02  ,04 say "Address Line 1 " OF oDlg RIGHT SIZE 45, 12
@03  ,04 say "Address Line 2 " OF oDlg RIGHT SIZE 45, 12

@01.2,10 get aOGets[1] VAR cAcName OF oDlg  valid !empty(cAcName)
aOGets[1]:cToolTip := "Please Type in the Account Name"
@02.3,10 get aOGets[2] VAR cAddr1 of oDlg Valid !empty(cAddr1) 
@03.4,10 get aOGets[3] VAR cAddr2 of oDlg Valid !empty(cAddr2) 

@05,02 BUTTON oBtnSave   PROMPT "Save" SIZE 50,15 OF oDlg
@05,15 BUTTON oBtnCancel PROMPT "Cancel" SIZE 50,15 OF oDlg CANCEL ACTION oDlg:End()

ACTIVATE DIALOG oDlg ;
	VALID ( oDlg:=NIL,;
	        .T.)
Return NIL


Regards

Anser
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Valid not getting evaluated after button click
Posted: Wed Oct 15, 2008 11:19 AM
Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Valid not getting evaluated after button click
Posted: Wed Oct 15, 2008 11:52 AM

Hi,

Thank you for the link

Regards

Anser

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Valid not getting evaluated after button click
Posted: Wed Oct 15, 2008 04:31 PM

Anser,

I must mention that whenever you require that a field not be empty, you may well end up with users entering meaningless data, just anything, so they can complete the screen. I would rather have the field left blank than have bad data entered into it.

Optionally, you can keep track of records that are missing data so they can be found and fixed at a later time. Or, you can just scan the database looking for fields that are blank that need to be filled out.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Valid not getting evaluated after button click
Posted: Thu Oct 16, 2008 05:00 AM
Dear Mr.James,

Very much true
whenever you require that a field not be empty, you may well end up with users entering meaningless data, just anything, so they can complete the screen


I have read your post's on this topic and have found that changing the back colour while entering erroneous data to attract the app. user's attention very impressive

Thankyou very much for your valid views regarding the interface designing part of application.

I am in a very preliminary stage and I am trying different available options and want to choose the most appropriate one to suit the requirement of my environment here.

Regards

Anser
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Valid not getting evaluated after button click
Posted: Thu Oct 16, 2008 02:27 PM
Anser,

You can also have a look at this topic http://forums.fivetechsoft.com/viewtopic.php?t=12972 where I talk about the same problem.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Valid not getting evaluated after button click
Posted: Fri Oct 17, 2008 05:19 AM

Thankyou Michel for the link

Regards

Anser

Continue the discussion