I am looking for a simple way to pre-fill a field in my contact form when ever a user clicks on a link that is given in some other page.
This is my contact form in h
You can retrieve your current url with window.location.href and then get the default message via a regular expression :
window.location.href
var msg = window.location.href.match(/\?setmessagefield=(.*)/); document.getElementById("message").value = msg[1];