Home » Developer & Programmer » Forms » trigger when validate item
icon4.gif  trigger when validate item [message #572851] Tue, 18 December 2012 03:26 Go to next message
jocelyne
Messages: 34
Registered: December 2012
Location: lebanon
Member
i need to pop up an alert using a trigger to test the data type of a field
per example if the input is not a number an alert will popup "Please insert a number"

ANY HELP PLEASE

[Updated on: Tue, 18 December 2012 03:27]

Report message to a moderator

Re: trigger when validate item [message #572864 is a reply to message #572851] Tue, 18 December 2012 04:40 Go to previous messageGo to next message
Littlefoot
Messages: 19339
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why do you think that you need that? If you set item's "Data Type" property, Forms will do that job for you.

For example (your example): if item's datatype is "Number" and you enter characters into it, Forms will display a message (in the status bar), saying "FRM-50016: Legal characters are 0-9 - + E ."

If you insist on your own "solution", you'll need to develop functions which will detect datatypes and raise an exception when value you enter doesn't match the one you expect.
Re: trigger when validate item [message #572893 is a reply to message #572864] Tue, 18 December 2012 07:46 Go to previous messageGo to next message
jocelyne
Messages: 34
Registered: December 2012
Location: lebanon
Member
thank you i will try to develop a function

now i have another question
how can i import data in a list item from the table not from the property palette?

thank you in advance
Re: trigger when validate item [message #572894 is a reply to message #572893] Tue, 18 December 2012 07:49 Go to previous messageGo to next message
cookiemonster
Messages: 10859
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do NOT write a function. You'll have to make all your items varchar datatype instead of the correct data type, which will sooner or later lead to corrupted data and/or other bugs. Let forms default functionality do what it needs.

Re: trigger when validate item [message #572897 is a reply to message #572894] Tue, 18 December 2012 08:12 Go to previous messageGo to next message
jocelyne
Messages: 34
Registered: December 2012
Location: lebanon
Member
ok deal thank you

but what about importing data to the list item from the table?
Re: trigger when validate item [message #572920 is a reply to message #572897] Tue, 18 December 2012 11:15 Go to previous message
cookiemonster
Messages: 10859
Registered: September 2008
Location: Rainy Manchester
Senior Member
look up the following builtins in form builder help:
add_list_item_element.
populate_list_from_group.
clear_list

Those names are from memory so some may be wrong (I'm not sure about the first one). The topics contain examples of what you need.
Previous Topic: how can calc net sal of month end
Next Topic: Custom Form
Goto Forum:
  


Current Time: Thu Jul 31 07:12:32 CDT 2014

Total time taken to generate the page: 0.14174 seconds