5

There is a form, and on submit, I convert it to a serialized string to in order to submit the form via ajax.

var data = $$.serialize();

Now there is an input field named 'title' and I want to get its value to show a message. So I am looking for a method to do just that. I've tried;

alert(data.name);

But found out it's not the method.

UPDATE

Here is the fiddle: http://jsfiddle.net/wHBYK/

Prasad N
  • 543
  • 4
  • 10
  • 22

1 Answers1

9

You don't need jQuery at all. Just do this:

$('#frmEditTab').submit(function(e){
    e.preventDefault();
    var title = this.title; //get the input named "title" of the form
    alert(title.value); //alerts the value of that input
});
Niccolò Campolungo
  • 11,824
  • 4
  • 32
  • 39