Home » Developer & Programmer » Forms » How to prevent user to enter data in multiple fields within a record
How to prevent user to enter data in multiple fields within a record [message #308183] Fri, 21 March 2008 14:52 Go to next message
michaelv
Messages: 20
Registered: November 2006
Location: rockville, MD
Junior Member
Hi,
Assume that i have a form with 3 field. However, only one field is allowed to have input. Let pick an example:

Form TEST has 3 fieds: A | B | C

if A has data, and user attempts to enter data at field B or C, the error should be raise and force user to delete A first before entering data for B or C.

thanks.
Re: How to prevent user to enter data in multiple fields within a record [message #308201 is a reply to message #308183] Fri, 21 March 2008 23:42 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
You can do this by checking you condition on WHEN-VALIDATE-ITEM.

Regards,
Azam Khan
Re: How to prevent user to enter data in multiple fields within a record [message #308235 is a reply to message #308183] Sat, 22 March 2008 10:03 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Just to add: check existence of value in item A and, depending on the result, enable or disable other items (using the SET_ITEM_PROPERTY built-in).
Re: How to prevent user to enter data in multiple fields within a record [message #308504 is a reply to message #308201] Mon, 24 March 2008 10:08 Go to previous messageGo to next message
michaelv
Messages: 20
Registered: November 2006
Location: rockville, MD
Junior Member
azamkhan wrote on Fri, 21 March 2008 23:42
You can do this by checking you condition on WHEN-VALIDATE-ITEM.

Regards,
Azam Khan



I have used that trigger. The problem is that when i raise form_trigger_failure, i can't move on even though i delete data from the field. I just want to popup the message to let user know that only one field allowed.

Looks like that when-validate-item only works independently. My situation is like to check one field but depend on the other two fields.
Re: How to prevent user to enter data in multiple fields within a record [message #308581 is a reply to message #308504] Tue, 25 March 2008 00:03 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
It is because of the RAISE FORM TRIGGER FIALURE. Why are you using RAISE if you dont want hang up the user on the same field.

Ok any ways... why dont you change you event like POST-TEXT item.

Regards,
Azam Khan
Re: How to prevent user to enter data in multiple fields within a record [message #309237 is a reply to message #308581] Wed, 26 March 2008 19:29 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No. Stick with the When-Validate-Item trigger but use the Set_Item_Instance_Property command to make the B and C fields NOT insertable and NOT updateable, even NOT navigable.

David
Previous Topic: How to read CLOB values into d2k form.
Next Topic: Field activation
Goto Forum:
  


Current Time: Fri Sep 27 10:23:36 CDT 2024