Forum Moderators: open
I have a short HTML form which gets the user details such as Name, email, phone and state.
There is a requirement to include the referral URL which I discovered I could use:
<script>
function start() {
var ref = document.getElementById('httpref');
ref.value = document.referer;
}
onload = start;
</script>
<input type="hidden" id="httpref" name="httpref" value="">
I have one problem though. If the referral url is example1.com, example2.com, example3.com it needs to send an email to whoever@wherever.com
but if the referal url is waydifferent.com it needs to send an email to another address.
Can this be done in javascript by using hidden input fields and if so what code should I use?
I hope that makes sense!