What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
I Would like a Setting in Textbox Properties Where Characters Other than Those Allowed with Current Validation Can Be SpecifiedAsked by rsvpfree on February 21, 2015 at 04:24 PM
I would like my users to be able to enter into a text box alphanumeric data such as "123 Hi-Grade Apts, Anytown" but this gets rejected with Validation set to ALphaNumeric because of both the 'dash' in "Hi-Grade" and the 'comma' after "Apts".
Is there a way I can validate entries as AlphaNumeric while allowing punctuation?
Thanks for asking. One workaround would be to set the validation back to the default (None) and add a notice under the field specifying which characters are not allowed. Next, create a condition to both show the notice and hide the submit button if any of those characters is included.
To better understand what I mean, please see this clone of your jotform. If any attempt is made to type certain characters into the Name of Group or Organisation: field, a notice appears under the field and the Create My Event button becomes hidden. (Once the submit button of a jotform is hidden, it cannot be submitted.) The forbidden characters in this case are:
! , @ , # , $ , % , ^ , * , ( and ).
If you clone the demo you'll see the following condition:
If you need clarification on anything, please let us know.
Thank you, abajan.
It looks like I can use this technique to "disallow" single characters like < and > or multiple-characters like &#
As you can guess, I am trying to prevent 'hacking' or 'XSS' problems by allowing code to be included in data provided by my users, but I don't want to stop them using ! or @ or $ or % or ( or ) as those would be perfectly valid characters for them to have in for example the title of an Event!
It would be even better if I could actually remove a "disallowed" character from the field, but I can't see how to do that...
If you can change this thread from (Private) to (Public) I would be quite happy with that, in case it might help other Jotform users.
Editing the condition so that !, @, $, %, ( and ) are allowed but left-angled brackets, right-angled brackets and the ampersand-octothorpe combos aren't is quite feasible, as demonstrated in this other version of your form.
When you state that it would be better if the disallowed characters could be removed from the field, do you mean that you would prefer to allow them to be submitted and then have them automatically removed after submission? Please elaborate.
As requested, the thread has been reset to Public. I had set it to Private only because my demo form is a clone of your own which you had not revealed in the opening post.
I just ran a test on this thread and it turns out that it's not fully public. Your replies are public but my replies (the ones tagged with (Private)) aren't. Moreover, the thread is displayed only temporarily before redirecting the viewer to the general forum.
I'll submit a ticket.
Hi again abajan. On second thoughts, "removing a "disallowed" character from the field" would probably have no advantages -- your method of preventing submission by removing the "Submit" button, and leaving the user to edit the field before proceeding, would probably be the best option.
Anyway, this is not a **vital** element of my form at this time; I was just curious as to why AlphaNumeric Validation excluded common punctuation. It would seem to make it fairly useless in many cases!
Hopefully the private/public bug you discovered will soon be fixed. When you say "I'll submit a ticket" is that a private ticket system for Support operatives? I haven't seen mention on the website of a users' ticket system....
Yes, the ticket system is only accessible to JotForm associates. The idea is that our support team would handle whatever queries we can and forward the rest to "Level 2". Each ticket would then be assigned to the most appropriate team member.
What I can do is submit a ticket requesting that the alphanumeric validation be more flexible. Perhaps we could have an extra setting where form creators can specify what characters besides strictly letters and digits are allowed or something like that.
Thanks, abajan. <<Perhaps we could have an extra setting where form creators can specify what characters besides strictly letters and digits are allowed or something like that.>> That's exactly what I was thinking!
No problem. The ticket has been submitted.