GIGO

Folder in the Trash

GIGO…Garbage In Garbage Out. This is a term that can sometimes be associated with data. Let’s face it, data is the lifeblood of any organization. In today’s marketplace, data analytics and data mining help organizations meet the needs of their clientele. So…that data needs to be protected to the utmost. This is where, as developers, we have a role to play.

DBA

Before I address the developer’s role, let’s chat about the database administrator’s (dba) role. It is their role to protect the data at all cost. Most good dba’s take this very seriously…and rightly so. As a developer, I sometimes don’t look at it that way and feel that it is a pain. “I mean, come on…just give me admin rights to the database and do a select asterisk so I can build cool apps!” I have said variations of this at times throughout my career. That quote is probably making dba’s skin crawl. They have a highly important job…let’s make it easier as developers. In comes data validation.

Data Validation Location

Data validation is performed in two main locations…server-side and client-side. I want to speak to the client-side in this post. This is the first line of defense and the easiest location to tend to things. Most data validation involves forms.

Let’s be real here…show of hands…how many of you have filled out a form, say a registration form, and put in bogus information just to get the form filled out and in the door? I thought so. Once that happens, the data is tainted. Developers can help prevent this.

There are two main ways to accomplish this…1) HTML constraints and 2) programmatic validation with JavaScript and Regular Expressions. I plan on addressing the coding side of things with regular expressions at a later date. For now, I want to speak to HTML constraints.

HTML Constraints

It can go a long way towards data validation when the proper HTML is used to build a form. Let’s say you are asking the end user for a date. HTML5 has a date input type field complete with drop down calendar! I recall building that by hand. That enhancement alone was worth the price of admission for me to HTML5. If the HTML is written with another input type, say a text field, well…you have opened the door to allow the end user to specify any date format they wish…which will lead to errors and possibly a knock on your door from your friendly. neighborhood dba.

Some examples of helpful HTML5 input types are:

  • search
  • email
  • url
  • tel
  • number
  • range
  • date
  • month
  • week
  • time
  • datetime
  • datetime-local
  • color

So make sure you select the proper HTML5 input types and constraints to make the rest of your validation easier.

Happy Coding!

Clay Hess

More To Explore

computer, laptop, work place-2982270.jpg
Code

Unlocking Wireless Communication: A Dive into the Bluetooth API

Wireless communication has become an integral part of our daily lives, and Bluetooth technology is at the forefront of this revolution, enabling devices to exchange data over short distances and creating a world more interconnected than ever before. At the heart of this technology lies the Bluetooth Application Programming Interface (API), a powerful tool for developers looking to harness the capabilities of Bluetooth in their applications. In this blog post, we’ll explore what the Bluetooth API is, how it works, and the possibilities it opens up for innovation in wireless communication.

lighthouse, beacon, atlantic-8578318.jpg
Code

Understanding the Beacon API: Simplifying Asynchronous Data Transfers

In today’s data-driven world, web applications often need to send data back to the server. Traditionally, this has been done using AJAX requests or similar methods. However, these techniques can come with a cost, especially when dealing with data that needs to be sent during the unload phase of a document, such as tracking and diagnostic data. This is where the Beacon API shines by allowing developers to send data to a server more reliably and efficiently.

Share This Post

small_c_popup.png

Need help?

Let's have a chat...


Login

Jump Back In!

Here at Webolution Designs, we love to learn. This includes sharing things we have learned with you. 

Register

Begin Your Learning Journey Today!

Come back inside to continue your learning journey.