Skip to main content

Form Validation

  • Chapter
jQuery Recipes
  • 1160 Accesses

Abstract

In this chapter we’ll see different ways of validating forms. We will be covering following recipes, from basic blank-field checking through to more complex password and field-disabling techniques:

  • Confirming a required field is not left blank

  • Validating a numerical field

  • Validating phone numbers

  • Validating a user ID

  • Validating a date

  • Validating an email address

  • Checking whether a checkbox is checked

  • Finding whether a radio button is selected

  • Checking whether an option in a select element is selected

  • Applying styles to options and a form button

  • Checking and unchecking all checkboxes together

  • Validating two fields

  • Matching the password and confirm password fields

  • Disabling certain fields

  • Validating a complete form

  • Serializing form data

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2010 B.M. Harwani

About this chapter

Cite this chapter

Harwani, B.M. (2010). Form Validation. In: jQuery Recipes. Apress. https://doi.org/10.1007/978-1-4302-2710-6_4

Download citation

Publish with us

Policies and ethics