Page 1 of 1

Javascript help - form script

Posted: Sun Oct 04, 2009 6:50 pm
by JKM
Hi there,

I got this code for a form to update the variable 'num' without reloading the page:

Code: Select all

var choose = document.getElementById("demovis");
choose.onchange = function() {
    var num = this.options[this.selectedIndex];
    if(num.value != "blank" ){
        window.location = "index.php?num="+num.value;
    }
}
Now, I want another select field, and when you select something in one of the fields, it should get values from both fields. index.php?num=XX&page=XX.

Re: Javascript help - form script

Posted: Mon Oct 05, 2009 1:04 pm
by kaszu
to update the variable 'num' without reloading the page
That code reloads the page :)

You already have the code needed, just change it to take 2 selects.
Try finding what on each of code lines is done and if you still can't get it to work, then post what you tried or maybe some ideas how you think that could be done and I'll help, but just writing code for you in my opinion is pointless.

Sorry if it sounds rude, I don't mean it like that.