Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple input type checks?

Featured Replies

On the website that I'm making, I have quite a lot of inputs that I ofcourse want to check when people are typing something in. But making a function for every single page is kind of annoying and I thought that there might be a better solution to this.

 

For example when registering an account it would check the 2 input types password and see if they're equal to eachother, if not it will change the class of the inputbox so it gets a red outline. And also for other stuff like email adresses.

 

So is it possible to do something like this in Javascript?

On the website that I'm making, I have quite a lot of inputs that I ofcourse want to check when people are typing something in. But making a function for every single page is kind of annoying and I thought that there might be a better solution to this.

 

For example when registering an account it would check the 2 input types password and see if they're equal to eachother, if not it will change the class of the inputbox so it gets a red outline. And also for other stuff like email adresses.

 

So is it possible to do something like this in Javascript?

I'd suggest using a framework which will make it much easier for you to validate inputs. Alternatively, make your own validation class(es) in PHP.

 

Not recommended to use Javascript for any serious validation - people can turn JS off, and you'll have a serious problem.

  • Author

I'd suggest using a framework which will make it much easier for you to validate inputs. Alternatively, make your own validation class(es) in PHP.

 

Not recommended to use Javascript for any serious validation - people can turn JS off, and you'll have a serious problem.

I already have that but I want to make it visible to the user when they're typing it in too, I just think it's a nice addition to the website and it'll make it easier for the user.

How about a jquery plugin? This will help when things are "requred" or making sure email addresses are correct or when needing to compare two fields.

 

Goodluck,

~evu.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.