Hi I have a link on my home page:
<a href="contact.html?id=Graphic Design#section1" class="btn btn-info">Get a Quote</a>
This link will take you to the contact page. I use this script below to autofill the subject field in my form with the id taken from the URL.
<script type="text/javascript">
window.onload=function(){
function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("="); if (ft[0] == ji) { return ft[1]; } }}
var id = querySt("id");
if( id==null){
}else{
document.getElementById('form_subject').value = id; } }
</script>
Because there is a space in the URL id (Graphic Design) it ends up in the form field like this: Graphic%20Design
I have read many post here that suggest how to remove the %20 but I have not been successful in implementing that. I'm not sure how or where to place code.
Any help is greatly appreciated. Thank you.