Focal Point
[SOLVED] Maintain / How to make an EditBox a required field?

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

October 20, 2015, 10:59 AM
Ali
[SOLVED] Maintain / How to make an EditBox a required field?
Hello everyone,
I have a simple maintain application that prompts the user to input several kinds of information such as First, Last names, address .. etc. I would like to force the user to insert data in one of the fields. I searched through the properties sheet for the Editbox object and couldn't find a property for this purpose.
Any ideas?

This message has been edited. Last edited by: Ali,


WebFOCUS Developer Studio 8104 / Windows 7 / HTML and Excel
October 20, 2015, 02:51 PM
CoolGuy
Ali,

In the HTML Composer tool, select the control (edit box) you want to validate. Then under its properties on the right, find the Selection and Validation property under Miscellaneous. This is the property setting that allows you to ensure the user enters something into this control. To make sure the user enters something specific into the control, you will have to add Js and probably use some regex to check for patterns in what the user enters. Unless there's some functionality that I missed that exists somewhere in the GUI that does this.

Good luck!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
October 20, 2015, 03:06 PM
Maintain Wizard
Hi Ali
There are a number of ways to make this happen. The quickest and easiest is to do this:
1) Inside the MDE, click on the editbox
2) Look at the Properties and locate IBIValidation
3) Select 2-Required

Now the user will not be able to leave the form without filling this value in. That's the easiest, but it CAN sometimes get annoying as you REALLY can't close the form without entering something.

The other thing that people do is to create a simple JavaScript event on the fields' BLUR event:

if (Form1.Field_Edit.value== '')
{
alert("Field cannot be blank");
Form1.Field_Edit.focus();
Return(false);
}

Where Form1 is the name of your form and Field_Edit is the name of your field.

Mark
October 21, 2015, 01:08 PM
Ali
Thank you Mark and CoolGuy,
I Both the validation and the JavaScript approaches work really well.

Marking this discussion as SOLVED

Ali


WebFOCUS Developer Studio 8104 / Windows 7 / HTML and Excel