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.
How can we set validation for no space in the text field.Asked by NeetaKapadia on December 11, 2011 at 06:26 AM
I have a field where I would like the user to enter only alphanumeric text without any space. How do I do that. Can you please let me know how to achieve that
Here's how you can set the validation for your text field:
1. Open your form
2. Click on the "user" text field
3. Click on "Properties: Name" on the top menu
4. Click on the "Validation" icon and set to "AlphaNumeric"
Hope this will help you. Thank you for using JotForm!
Unfortunately, we don't have direct tool for no space validation but If you like, you can try this workaround. In order to achieve that you need to download your form's full source code, here's a guide for that: http://www.jotform.com/help/104-How-to-download-a-source-code-of-your-form
After downloading your form's source code, open the html file (can be found on the downloaded form files).
On the html code, under <head> tag please add the code below:
alert('Sorry, you are not allowed to enter any spaces');
After that, add this code onkeyup="nospaces(this)" inside the Text Box code. (This should be the Text Box where you don't want to allow any spaces. Please see sample structure below.)
<input type="text" name ="textbox" id="textbox" onkeyup="nospaces(this)">
Here's sample demo: Click HERE
Let me know if you have further questions. Thanks.
Nice code. Thanks idarktech
In behalf of my colleague, we're glad to be of help, if you have further questions feel free to contact us.
Thanks for using JotForm!
Thankx idarktech... this was helpful....
what is the meaning of symbols in code
please give the answer
The code above is called regex code that is used to find and if found remove space characters from the text.
Now, as this is a very old thread, if you have any further questions in regards to this, please let us know by opening your own thread.
I was searching for the long time no one put executable code. Every person is misguiding. Thanks for the code it is 100% working and running fine on my page.
Thanks Bro..Awesome It Is!
Thankyou it was helpful
Thanks It's worked well
I have moved your question to separate thread and we will provide you an answer there shortly.