Save 37% off PRO during our Black Friday Sale! »

Forms

 Forms

A few examples on val, blur, focus, change and submit.

88bc30284c6a424b63a92aad27d0ba36?s=128

John Nunemaker
PRO

November 17, 2010
Tweet

Transcript

  1. jQuery and Forms

  2. .val() Gets the input of the first matched element http://docs.jquery.com/Attributes/val

    http://teaching.johnnunemaker.com/capp-30550/examples/val-method/
  3. .focus() Bind a function to the focus event of each

    matched element. The focus event is fired when an element receives focus from the mouse or by pressing tab. http://docs.jquery.com/Events/focus#fn http://teaching.johnnunemaker.com/capp-30550/examples/focus-a-field/ http://teaching.johnnunemaker.com/capp-30550/examples/focus-event/
  4. .blur() Bind a function to the blur event of each

    matched element. The blur event fires when an element loses focus either via the mouse or by pressing tab. http://docs.jquery.com/Events/blur#fn http://teaching.johnnunemaker.com/capp-30550/examples/blur-event/ http://teaching.johnnunemaker.com/capp-30550/examples/blur-validation/
  5. .change() Binds a function to the change event of each

    matched element. The change event fires when a control loses the input focus and its value has been modified since gaining focus. http://docs.jquery.com/Events/change#fn http://teaching.johnnunemaker.com/capp-30550/examples/change-event/
  6. .submit() Bind an event to the submit event of each

    matched element. http://docs.jquery.com/Events/submit#fn http://teaching.johnnunemaker.com/capp-30550/examples/submit-event/
  7. Assignment 12 http://teaching.johnnunemaker.com/capp-30550/sessions/jquery-forms/