JSFiddle - React, Tailwind, and code Playground
HTML
<form action="http://domain.com/index.php" method="post" name="contact_form" id="contact_form">
<input id="yourName" type="text" name="yourName" value="">
<input id="yourEmail" type="text" name="yourEmail" value="">
<input id="message" type="text" name="phoneNumber" value="">
<input type="hidden" name="fromurl" value="http://www.google.com" id="fromurl">
<textarea id="messagex" name="message" rows="10"></textarea>
<button type="submit">Send</button> </form>
JavaScript
(function ($) {
$("form#contact_form").submit(function (event) {
var value1 = $("#fromurl").val();
console.log(value1);
//Use .html() to set the value of textarea
var txtArea = $('#message').val();
$('#message').val('');
console.log(" input "+txtArea);
$('#message').val(txtArea+value1);
return false;
});
})(jQuery);