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.

Javascript Form Validation

Featured Replies

Hi,

 

I have a contact form which is validated with PHP but I would also like to have a javascript that input in to the form field - "This field is incorrect" would any one know who to this? or point me in the direct?

Here is one example. Are you currently using a javascript library? If you are I'd suggest you used a validator that is compatible with that, if not I'd reccommend a jQuery one.
  • Author

Thanks I am using the JQuery library however today is the first I look at it, it looks a bit dauntig and huge

  • Author

that was relativly painless, however it has not stopped my server side validation :-( any ideas

What do you mean it hasn't stopped your server side validation?

 

If you are planning on only using javascript to check the users input, dont!. Javascript can easily be turned off by the user.

  • Author

sorry mis-typed, I have server side validation, checking if the fields are null and match my set regular expressions, I added javascript to highlight where the errors are etc, but the javascript is now stopping the server side stuff working.

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.