Entries tagged "form validation"

Improve Email Validation in Qualtrics Forms

I received a Qualtrics form submission where the email field, which is supposed to be required, was left blank. The customer emailed me shortly thereafter about the situation. She let me know what email address she tried entering, but the form kept saying it was invalid. Well, the address she sent should have worked. Therefore, I needed to look into why it didn't and figure out how she was able to submit the form without entering an email address. [Continue reading]

How to Test Form Submissions: Using Google Chrome to Change Form Values

When forms are set to the POST method, it may not be apparent how you can test responses made through fields like radio buttons. Of course, you can click each radio button to make sure each individual value can be submitted. But how do you make sure that someone can't tamper with the form and submit an invalid value. Let's take a look at how the browser can help. [Continue reading]

How to Test Submissions from Forms that Use the POST Method

An important part of developing online forms is testing. One area of testing I've always wanted to better with is making sure input types like radio buttons can't accept values which are not allowed. In this week's post, we go over my primary method of testing. That way we can discuss a faster way next time. [Continue reading]

Disable the Maxlength Attribute on Any HTML Form Field

HTML forms have a feature for limiting the amount of characters someone can enter into a field. While this feature can be useful, be aware that it is easy for the limitation to be bypassed. Let's take a quick look at one bypass method. [Continue reading]

Make Sure Things Are Working Correctly in JavaScript with the alert() Method

My usage of JavaScript can be a bit sporadic. There are times when I go months without writing a line of JavaScript code. So I find myself forgetting how to do certain things. It also doesn't help that most of my time is spent with PHP which adds to the confusion since the languages have different aspects to them. To help get my bearings, I've used JavaScript's alert() method to quickly see things like what value a variable contains. Let's look at a simplified example showing how I use alert(). [Continue reading]

Remove White Space from Form Data to Avoid Potential Headaches

When processing form submissions, it's important to remove white space before and after each value. Those extra spaces will likely go unnoticed by most visitors, but luckily this won't be a problem most of the time. In some cases, however, those spaces can lead to a lot of confusion. [Continue reading]

Naming Your HTML Form Fields with an Associative Array

When using database entries to dynamically build HTML forms, how do you go about naming the form fields? Do you name them "Field1", "Field2′, etc.? Or do you have a more efficient way to access the fields when processing the form submissions? If you haven't tried using an array as the name, you may be missing out. [Continue reading]

Make Sure Those Passed IDs Contain Numbers

When passing row IDs between pages, it's a good idea to check the value is what you expect. Values which could be tampered with by the user need to validated and sanitized. So, if an ID is supposed to be a number, we should make sure it is before running the database query. Let's discuss some options for checking for numbers. [Continue reading]

Getting Your Projects Done Faster by Writing Less Code with the Short-hand if()

Have you coded a simple if() construct that sets a variable to one of two values and thought to yourself "Five lines of code; there should be a better way?" Okay, maybe it's just me. Either way, let's take a look at the Ternary Operator [aka the short-hand if()]. [Continue reading]