Question

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?

Was it helpful?

Solution

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

OTHER TIPS

This should work:

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top