views:

372

answers:

2

Hey Guys,

Here's the story.

I have a form with some form fields.

Example:

  • name
  • email
  • message

What I would like to do is when I click to submit the form, get JQuery to grab the email field value and append it to the message field.

I have the value stored here:

var email = $('#email').val();

Any ideas?

+2  A: 
$("#message").val ($("#message").val () + $('#email').val());
AlbertEin
A: 

This should work:

$("#message").val( $("#message").val() + $('#email').val() );

knabar