Home » SQL & PL/SQL » SQL & PL/SQL » Text Box Validation Using a Trigger
Text Box Validation Using a Trigger [message #624] Mon, 25 February 2002 02:36 Go to next message
Greg Horton
Messages: 37
Registered: February 2002
Member
The trigger below is what i have coded myself. I have a text box on a canvas that requires the user to enter a numerical value (real or integer) between 0 and say, 1000. If the data entered is not in this range or is not numeric, i would like to raise an exception message that i can customise.

Can you suggest a way that i can implement these requirements using a trigger? Perhaps i need only improve the trigger that i have already, although im not too sure..

DECLARE
v_occurances NUMBER;
BEGIN
v_occurances := :mine_data.support_value_text;
IF v_occurances NOT BETWEEN 0 AND 1000 THEN
Message('Support values must be between 1 and 1000.');
RAISE Form_Trigger_Failure;
END IF;
END;

Thanks,

Greg
Re: Text Box Validation Using a Trigger [message #627 is a reply to message #624] Mon, 25 February 2002 03:17 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
i think your trigger is fine
Re: Text Box Validation Using a Trigger [message #629 is a reply to message #627] Mon, 25 February 2002 03:21 Go to previous messageGo to next message
Greg Horton
Messages: 37
Registered: February 2002
Member
The trigger works but the error message is displayed in the status bar, whereas id prefer it to be displayed in an alert box. Any suggestions?

Thanks again!

Greg
Re: Text Box Validation Using a Trigger [message #631 is a reply to message #627] Mon, 25 February 2002 03:51 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
what is the error ?
is it FRM-50016 ?

Then write this code in ON-ERROR trigger(form_level)

if error_code=50016 then
message('you can not input character here');
message(' ');
else
message(error_text);
end if;
Previous Topic: Clear Form Trigger
Next Topic: jdbc oracle function connectivity
Goto Forum:
  


Current Time: Tue Apr 16 13:11:00 CDT 2024