1 Replies - 712 Views - Last Post: 10 December 2011 - 03:53 PM

#1 jaArch   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 217
  • Joined: 23-March 10

JQuery Form Validation

Posted 10 December 2011 - 06:39 AM

How can I get the value of an input textbox using JQuery if I were to use something like in Javascript:

if (document.getstuff.fullname.value == "") {
                    errMsg[i++] = 'Name is blank. Please fill it in.';
                }


Also, how can I display the error messages the same way I did in Javascript? I'm just not sure how I could do this

Is This A Good Question/Topic? 0
  • +

Replies To: JQuery Form Validation

#2 e_i_pi   User is offline

  • = -1
  • member icon

Reputation: 879
  • View blog
  • Posts: 1,893
  • Joined: 30-January 09

Re: JQuery Form Validation

Posted 10 December 2011 - 03:53 PM

$('input[name="fullname"]').val()


That will get the value of the input element with the name "fullname".
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1