This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Feature request: custom field verification
Started 14 years ago by williamansley | 4 posts |
-
I would like to see an advanced feature added for custom field verification, at least for single line text fields (I'm not sure it would make sense for any other field type). I would like two new "slots" to be added to the field properties for single line text fields: one that will hold a regular expression and one that will hold a custom error message. This way, you could add custom verification to a field on a form without having to edit the base code and without having to wrap the custom code inside conditional code to keep it from being executed in the wrong form.
For example, at my community college we have a student ID number (known as an "A #") that must be an uppercase A followed by exactly 8 digits. I have added custom code to the "includes/post-functions.php" file to check to see if the user has typed in a valid A#. If the feature I requested existed, then I could just create a new single line text field in a form and, in the advanced section, paste this code into the regexp field:
^A[0-9]{8}$
and this text into the custom error field:
Please supply a valid A#.
Then, if the user typed some text that didn't match the regexp into the single line text field and submitted the form, the custom error text would show up under that field.
This wouldn't handle all possible cases of custom field verification, but it should handle a lot of them. If anyone else thinks this would be a good idea and has any comments or questions, I'd be glad to hear them.
Posted 14 years ago # -
I would still like to see this feature added to Machform. In my original message, I didn't mention the most important benefit of having this feature: It would allow custom field verification to be added to a form on a form-by-form basis, *without* having to modify the baseline code. This feature would give Machform users a lot more flexibility for input verification. While using regular expressions is difficult, and perhaps not many people would use this feature at first, it would add a lot of power to Machform and those who are regexp experts could share their solutions in this forum.
The way I think this should work is:
1. If the field is left blank, then Machform will check to see if the field is required. If not, then Machform will do nothing and the form can be submitted, if all other fields are OK. If the field is required, then Machform will keep the form from being submitted, as usual, until it is filled in.
2. If the field is filled in, then Machform will see if it matches the custom regular expression (regexp). If it does, the form can be submitted, if all other fields are OK. If not, then Machform will not allow the form to be submitted, highlighting the field with custom verification and displaying the custom error message text.
Posted 14 years ago # -
This one is a bit problematic to implement. Technically speaking, it's relatively easy to allow custom validation using custom regex.
However, as you might know already, regex is not easy to learn and not everyone has programming knowledge to do this.I don't think we'll have the time and resources to support every regex questions and we can't advertise machform as "easy to use" anymore if the regex is hard to use.
I understand that advanced users really need this functionality, but we rather stay in the middle. Adding more features to MachForm, without sacrificing the ease of use.
That being said, we don't have any plan to add regex but always open for any suggestions.
MachForm Founder
Posted 14 years ago # -
Thank you very much for your response. While I understand your position on this matter, I don't agree with it. You already have such advanced features as allowing people to add their own custom CSS code to their themes. While CSS coding may not be very high on the difficulty scale compared to regexp, it is still something that many people who use Machform as a point and click product are not prepared to do. So Machform is already *not* easy to use, to some extent.
As far as support goes, you already offer limited support for people who want to modify your code, but you can't and don't tell people how to make major modifications to your code or offer to do it for them. I don't see why you couldn't treat regexp questions the same way. I think most people won't use this feature, but those who will want to will also either already know regexp, or, like me, will be willing work out the regular expressions they need on their own. And those users will be really, really glad to have this option.
One of the most appealing features of your product is that you provide the source code for your users to modify. But this is both good and bad. I have taken advantage of this to modify Machform 2 to provide some custom verification, but now that we are in the process of upgrading to Machform 3, I am beginning to regret having made those changes, since I am going to have to do it all over again. The more ways you provide to allow Machform users to customize the product *without* having to modify the baseline code, the happier those users are going to be in the long run.
I don't expect to change your mind. I have had my say and I won't bring out this topic again (although I may respond if someone else brings up a similar idea on this forum in the future). Finally, although it may not always seem like it, I do think that Machform is a fantastic product and I do appreciate the tremendous amount of work all of you at Appnitro have put into it. And I appreciate the support you provide, which is often well above and beyond what I have gotten from most other software companies I deal with.
Posted 14 years ago #
Reply
You must log in to post.
