Focal Point
IBIValidation and Canceling *RESOLVED*

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/52110965

March 24, 2009, 11:32 AM
dendem
IBIValidation and Canceling *RESOLVED*
I am creating a maintain that ties to an Access database. I was interested in trying the IBIValidation in my data entry screens. It works great except for one thing. The two buttons I want to use are Submit and Cancel at the bottom of the form. If they cancel the form I don't want it to check if the required fields are entered. I can't seem to do this. Any idea?

WebFocus 7.6.5
Access Database
Windows Server 2003

This message has been edited. Last edited by: dendem,
March 25, 2009, 10:13 AM
Maintain Wizard
The way that I got around this was to add code behind my Cancel button. I created a JavaScript trigger and a line like this for all my required fields:

Form1.First_Name_Edit.value = ' ';
IWCTrigger("ExitApp");


This way, the field gets a default value and you don't get the error that you have to enter a value.

Mark
March 25, 2009, 10:47 AM
dendem
quote:
IWCTrigger("ExitApp");



Could you please supply me with sample code for canceling out of the form? I don't know how to close the form in Javascript so as to show the previous unclosed form that opened the data enrty screen.
March 25, 2009, 11:10 AM
Maintain Wizard
If the form that you are on is a child of a previous form, then create a case in your code like:

Case closeform
Winform Close Formname -* Where Formname is the name of the current form you are on
Endcase

Then, use the JavaScript to do:

IWCTrigger("Closeform");

Mark
March 25, 2009, 11:26 AM
dendem
When I try this I get the same results as before. I tired just closing the form as you showed above and also setting all the required fields to have values before closing and both don't resolve the issue. It still is requesting the fields be filled in.
March 25, 2009, 11:41 AM
dendem
To be more specific, The Cancel button uses Javascript to call the maintain case. The case then sets the stack fields that are tied to the form text boxes to 0 for all required fields.
March 25, 2009, 11:42 AM
Maintain Wizard
Make sure that you are not getting a JavaScript error when you click the CANCEL button. Make sure that the command correctly reflects the name of your form and the field. Remember, with JavaScript case matters. The word value is in lower case, but the name of the form and the field should reflect the case of your form and field.

If the JavaScript code looks correct and CANCEL is still giving an error, ZIP up the MNT file, the MAS files, repro steps and anything else I would need to repro the issue and send them to: Mark_Derwin@IBI.COM.

Mark
March 25, 2009, 12:18 PM
dendem
I sent it to you. Thank you Mark.