Home » Developer & Programmer » Forms » Editors, messages, and restrictions
Editors, messages, and restrictions [message #141428] Mon, 10 October 2005 03:53 Go to next message
orahugo
Messages: 32
Registered: October 2005
Location: England
Member
Hello,

How can you write the code to display a message when a certain condition is reached?

I have an editor box. It is called from a mousedoubleclick trigger when someone double clicks in a field. It allows the client to change/enter user information.

However, the field is only 100 characters long. I want to restrict the user from entering more than 100 characters in the editor box as when they do this and enter it, all the information becomes lost and there is nothing displayed in the field.

The editor box seems to have no restriction to the amount of data put in. Ideally I'd like to set a restriction, but I'm guessing I can't so all I could think was to do an "if length(variable) > 80" kinda thing.

I currently use form builder.

Thanks in advance.
Re: Editors, messages, and restrictions [message #141454 is a reply to message #141428] Mon, 10 October 2005 06:17 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
Yeah the way you thought is correct.

Probably you can use "Post_Change" trigger, and can try using

If length(editTxt) > 100 then
Message('more than maximum length 100')
End If

--Kiran.
Re: Editors, messages, and restrictions [message #141548 is a reply to message #141428] Mon, 10 October 2005 18:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If you set the 'physical/width' and 'data/maximum length' to the database length then the user can NOT enter more characters than will fit into the database field. So testing is not necessary.

David
Re: Editors, messages, and restrictions [message #141673 is a reply to message #141548] Tue, 11 October 2005 10:10 Go to previous messageGo to next message
orahugo
Messages: 32
Registered: October 2005
Location: England
Member
djmartin wrote on Mon, 10 October 2005 18:24

If you set the 'physical/width' and 'data/maximum length' to the database length then the user can NOT enter more characters than will fit into the database field. So testing is not necessary.

David


For some reason this doesn't affect how many characters you can put into the editor. Any further ideas?

[Updated on: Tue, 11 October 2005 10:11]

Report message to a moderator

Re: Editors, messages, and restrictions [message #141749 is a reply to message #141673] Tue, 11 October 2005 23:14 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Which version of Forms are you running and on what platform?

David
Re: Editors, messages, and restrictions [message #141784 is a reply to message #141749] Wed, 12 October 2005 02:40 Go to previous messageGo to next message
orahugo
Messages: 32
Registered: October 2005
Location: England
Member
6i.
Re: Editors, messages, and restrictions [message #141943 is a reply to message #141784] Wed, 12 October 2005 19:27 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I have tried a simple example in Forms 6 (not 6i) and it performs as I mentioned previously. I am using the default editor.

Please revisit your database definition and form. Verify the length in the database, make an item based on that field, make the 'Physical/Width' and 'Data/Maximum length' equal to the database length. Make sure that 'Editor/Editor' is null (press the 'Inherit' button to reset the value to 'default' if the field is currently set to something else eg. 'SYSTEM_EDITOR'). Add a When-Mouse-Doubleclick trigger containing 'edit_textitem'. Run the form and double click the field. On my machine (Unix C/S through X-Windows) it stops accepting further input after the maximum number of characters have been entered.

I will do a search of metalink for a patch in a minute. Which patchset of 6i are you using (I hope either pacthset 4a or patchset 13 or higher, but NONE inbetween).

David

[Updated on: Wed, 12 October 2005 19:27]

Report message to a moderator

Previous Topic: oracle froms 6i replecing menus
Next Topic: help file need call at the run time & CHM help file in forms 10 g (merged)
Goto Forum:
  


Current Time: Fri Sep 20 14:28:58 CDT 2024