Hi all, I am using the following piece of code in my java script file to retrieve the ids of checked check boxes from a div named "list". I am appending the arrays of ids in the url using the "location.href = location.href+"?array=true&0="+course;" etc. I can see the array in the address bar but using $REQUEST or $GET does not help me fetch the values.
Please have a look at my code and help me as soon as possible. This problem has already taken a lot of my time. Thanx in advance.
function ApplySelectedChanges() { var Checked_tables_ids = new Array();
var div = document.getElementById("list"); var input_fields = div.getElementsByTagName('input'); var x = input_fields.length; var i; var append_string; for (i=0; i<x; i++) { if (input_fields[i].type == 'checkbox') { if (i == 0) { append_string = "?abc="+1234+"&"; } else { append_string += "&"; } Checked_tables_ids[i] = input_fields[i].id; append_string += i+"="+input_fields[i].id; } } location.href += append_string; }
Zahra Naeem a écrit :
Hi all, I am using the following piece of code in my java script file to retrieve the ids of checked check boxes from a div named "list". I am appending the arrays of ids in the url using the "location.href = location.href+"?array=true&0="+course;" etc. I can see the array in the address bar but using $REQUEST or $GET does not help me fetch the values.
Please have a look at my code and help me as soon as possible. This problem has already taken a lot of my time. Thanx in advance.
function ApplySelectedChanges() { var Checked_tables_ids = new Array();
var div = document.getElementById("list"); var input_fields = div.getElementsByTagName('input'); var x = input_fields.length; var i; var append_string; for (i=0; i<x; i++) { if (input_fields[i].type == 'checkbox') { if (i == 0) { append_string = "?abc="+1234+"&"; } else { append_string += "&"; } Checked_tables_ids[i] = input_fields[i].id; append_string += i+"="+input_fields[i].id; }
} location.href += append_string; }
I did not analyse your code, but if you look at $_REQUEST very early in the script (at the very beginning) I bet you'll see your values. They are probably "cleaned" because you might have forgotten to include the current token in your URL. See libraries/url_generating.lib.php.
On 24.07.2009 13:57, Marc Delisle wrote:
Zahra Naeem a écrit :
Hi all, I am using the following piece of code in my java script file to retrieve the ids of checked check boxes from a div named "list". I am appending the arrays of ids in the url using the "location.href = location.href+"?array=true&0="+course;" etc. I can see the array in the address bar but using $REQUEST or $GET does not help me fetch the values.
Please have a look at my code and help me as soon as possible. This problem has already taken a lot of my time. Thanx in advance.
function ApplySelectedChanges() { var Checked_tables_ids = new Array();
var div = document.getElementById("list"); var input_fields = div.getElementsByTagName('input'); var x = input_fields.length; var i; var append_string; for (i=0; i<x; i++) { if (input_fields[i].type == 'checkbox') { if (i == 0) { append_string = "?abc="+1234+"&"; } else { append_string += "&"; } Checked_tables_ids[i] = input_fields[i].id; append_string += i+"="+input_fields[i].id; } } location.href += append_string;
}
I did not analyse your code, but if you look at $_REQUEST very early in the script (at the very beginning) I bet you'll see your values. They are probably "cleaned" because you might have forgotten to include the current token in your URL. See libraries/url_generating.lib.php.
and, if i remember right, numerical variables are all filtered out independent of valid token