How to pass 2 variables through url

Results 1 to 2 of 2

Thread: How to pass 2 variables through url

  1. #1
    Join Date
    Dec 1969
    Posts
    48

    Default How to pass 2 variables through url

    Hey, I am passing a variable "e" below through url and it's working:

    <script>
    $("#submitPlan").click(function () {
    var e=document.getElementById("control_COLUMN45").valu e;
    var f=document.getElementById("control_COLUMN46").valu e;

    document.forms[0].action='http://www.sample.com/sign_up/Form?plan='+e+"_end";
    });
    </script>

    When i add another variable "f" and edit the url below, it's passing both variables:

    document.forms[0].action='http://www.sample.com/sign_up/Form?plan='+e+f+"_end";

    But i want to use similar to this (so the url has the value for plan and plan2) and it's not working:

    document.forms[0].action='http://www.sample.com/sign_up/Form?plan='+e+"_end"&plan2='+f+"_end"&;

    Any help/suggestions.

    Thanks!

  2. #2
    Join Date
    Dec 1969
    Posts
    48

    Default

    I actually able to figure it out and it's working. Here is code that is working:

    document.forms[0].action='http://www.sample.com/sign_up/Form?plan='+e+"_end"+"&plan2="+f+"_end2";

    Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •