setting the variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • reneecccwest

    #1

    setting the variables

    I like to set the variable to something else and embedded in the url string.
    where did I do wrong?

    aholder = document.orgzfo rm.a.value;
    bholder = document.orgzfo rm.b.value;
    cholder = document.orgzfo rm.c.value;

    //set values into a variable
    var passurlvalue = "&aID" + aIDholder + "&bID" + bIDholder + "&cID" + cIDholder


    //Passing the values
    location.href=" orgz03.cfm?&ree dit=1" + "&j=" + jholder + passurlvalue;

    thanks in advance,
    s/RC
  • mscir

    #2
    Re: setting the variables

    reneecccwest wrote:
    [color=blue]
    > I like to set the variable to something else and embedded in the url string.
    > where did I do wrong?
    > aholder = document.orgzfo rm.a.value;
    > bholder = document.orgzfo rm.b.value;
    > cholder = document.orgzfo rm.c.value;
    > //set values into a variable
    > var passurlvalue = "&aID" + aIDholder + "&bID" + bIDholder + "&cID" + cIDholder
    > //Passing the values
    > location.href=" orgz03.cfm?&ree dit=1" + "&j=" + jholder + passurlvalue;[/color]

    You declare variable "aholder" but you refer to variable "aIDholder" in
    the string. Also you include an ampersand immediately after the question
    mark, I believe you don't want to use one there. See if this works for you:

    function buildurlstring( ) {
    var aIDholder = document.orgzfo rm.a.value;
    var bIDholder = document.orgzfo rm.b.value;
    var cIDholder = document.orgzfo rm.c.value;
    var baseurl = 'orgz03.cfm';
    var passurl = '?reedit=1';
    passurl += '&j=' + jholder;
    passurl += '&aID='+aIDhold er;
    passurl += '&bID='+bIDhold er;
    passurl += '&cID='+cIDhold er;
    location.href=b aseurl+passurl;
    }

    Mike

    Comment

    Working...