Paolo Posted February 20, 2003 Posted February 20, 2003 Is there any way to avoid the insertion of carriage returns into fields ? I need some fields to be one line only. thank you
LaRetta Posted February 20, 2003 Posted February 20, 2003 Hi Paolo Oh indeed there is! I fought the same problem. You can use validation by calculation in field definition like this: not PatternCount(yourtextfield, "
Paolo Posted February 20, 2003 Author Posted February 20, 2003 First, thank you. This solves my problem only in part, since I'm trying to avoid CR at the time the user presses the key. What I have is a "login" layout where the user types username and password (into two global fields) and then presses the "Ok" button that performs the validation check script. User are used to press CR after they type the password instead of pressing "Ok". However this doesn't run the script, it only add a line in the password field.
LaRetta Posted February 20, 2003 Posted February 20, 2003 Hi Paolo, I'm trying to avoid CR at the time the user presses the key. What I described would be in your "Field Definitions" using Validation by Calculation and would certainly stop a User from hitting return immediately when they did it. They they'd hit the OK button to run your script. What version of FM are you using? Depending upon your version, you probably can validate a global field. To accomplish this, change your global text field to a regular text field in Field Definitions, apply the validation by calculation using the formula I provided then go back and change the field back to a global text field again. Users will be stopped COLD!! I promise. Regardless of whether you stop the User as soon as they hit enter, or whether you remove the carriage returns when the script runs, the Users will still have to hit the OK button to run the script. If you want the script to run upon field exit, you should use a plug-in. LaRetta
Lee Smith Posted February 20, 2003 Posted February 20, 2003 Are you using a Set Field script step in moving the global to the permanent field? If so, you could add the Substitute in your set field step. i.e. Set Field [ [ YourRealField, Substitute(g_YourGlobalField, "
Paolo Posted February 21, 2003 Author Posted February 21, 2003 What I described would be in your "Field Definitions" using Validation by Calculation and would certainly stop a User from hitting return immediately when they did it. They they'd hit the OK button to run your script. I was able to validate the global field but the user is not stopped until she exits the field (with tab or a mouse click somewhere)
LaRetta Posted February 21, 2003 Posted February 21, 2003 Hi Paolo! Yes, then you have it right! You asked for a method to stop the insertion of carriage returns into the field. Immediate means during data-entry, as compared to having to run a script through your data later to clean it up. Your Users can't go to the next field until it's corrected! It will eliminate the need to run stripping scripts through your data and, if you search this Forum, the problems with carriage returns is major pain! If what you want is to have your script run when the User hits enter, you'll probably need a plug-in LaRetta
Pupiweb Posted February 22, 2003 Posted February 22, 2003 Use a numeric field (eventually a global number field) for the data entry ... cannot be used in all circumstances but doesn't allow any carriage return
Recommended Posts
This topic is 8016 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now