How to append more than one variable with value to url in javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amel86
    New Member
    • Apr 2010
    • 25

    #1

    How to append more than one variable with value to url in javascript

    hello.
    please help me how can i add one more variable at this code >

    Code:
    onChange="getmodel('mlm-edit.php?category='+this.value)"
    for example i want add 2nd value besides 'this.value'
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    create another function
    say
    Code:
    function another()
    {
     var uri=mlm-edit.php?
       +"category="+encodeURI(document.getElementByID("obj1_id").value)
    +"&data2="+encodeURI(document.getElementByID("obj2_id").value)
    ...
    ...
    ...
    +"&datan="+encodeURI(document.getElementByID("objn_id").value)
    getmodel(uri);
    }
    now from your button call another function
    Code:
    onChange="another()"
    To understand more search on internet with URI

    Best Regards,
    Johny

    Comment

    Working...