• Ashley Freiheit
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello, 

Completely new to Java so please be kind... 

I'm trying to configure a web to lead form to redirect to 2 separate landing pages based on the current URL (the source URL that the user is filling out the form on). I'm not sure if I should be using window.location.href or getCurrentURL... or something else? Here is what I'm currently using, but this doesn't seem right: 

function setReturnURL() {
        if(document.getElementById('window.location.href').value == 'https://CurrentURL.com') {
            document.getElementById('retURL').value = 'https://LandingPage.com';
        } else if(document.getElementById('window.location.href').value == 'https://CurrentURL2.com') {
            document.getElementById('retURL').value = ''https://LandingPage2.com';
        }
 
Hello, 

I'm creating a web to lead form. One of the fields is supposed to be numeric values only, but I cannot create it as a number field because there cannot be commas in the values. I made it a text field and am attempting to create a validation that only allows numeric values, and doesn't allow the form to be submitted and throws an error to the person filling out the web form. I've added the below code to my form, but I'm not getting an error and leads are being created. Can someone spot check my javascript, as I'm totally new to this. Note: I do have ValidateForm as my form action upon submit. 

<script type='text/javascript'>
    function ValidateForm() {
        if  (isNaN(document.getElementById('MemberAccountNumber').value {
            alert("Member Account Number must only contain numeric values");
            return false;
        }
        return true;
    }
</script>
<script type='text/javascript'>
    function ValidateForm() {
        if  (isNaN(document.getElementById('MemberAccountNumber').value {
            alert("Member Account Number must only contain numeric values");
            return false;
        }
        return true;
    }
</script>



Thank you
 
Hello, 

I'm creating a web to lead form. One of the fields is supposed to be numeric values only, but I cannot create it as a number field because there cannot be commas in the values. I made it a text field and am attempting to create a validation that only allows numeric values, and doesn't allow the form to be submitted and throws an error to the person filling out the web form. I've added the below code to my form, but I'm not getting an error and leads are being created. Can someone spot check my javascript, as I'm totally new to this. Note: I do have ValidateForm as my form action upon submit. 

<script type='text/javascript'>
    function ValidateForm() {
        if  (isNaN(document.getElementById('MemberAccountNumber').value {
            alert("Member Account Number must only contain numeric values");
            return false;
        }
        return true;
    }
</script>
<script type='text/javascript'>
    function ValidateForm() {
        if  (isNaN(document.getElementById('MemberAccountNumber').value {
            alert("Member Account Number must only contain numeric values");
            return false;
        }
        return true;
    }
</script>



Thank you