P
Prince Al
Hi,
I am attempting to write a dynamic javascript page. There is a button
on the page that when clicked, calls a function that adds some hidden
fields to a form and then submits it. The submit appears to work fine
(i.e. it calls the CGI script), but the query string is empty, using
GET or POST methods. A cut down version of my code is:
function sub() {
var tables =
document.getElementById("outer").getElementsByTagName("table");
var form = document.getElementsByTagName('form')[0];
for (i=0; i<tables.length; i++) {
var columns=i;
var truncs=i;
var links=i;
var sorts=i;
form.appendChild(createTextBox("cols_"+i,columns));
form.appendChild(createTextBox("links_"+i,links));
form.appendChild(createTextBox("truncs_"+i,truncs));
form.appendChild(createTextBox("sorts_"+i,sorts));
}
form.submit();
}
My form definition is:
<form name="theForm" method="get" action="cgi-bin/
create_driver.pl">
</form>
The submit button is created dynamically and calls the sub function
correctly. The submit button is created as a child to theForm.
I am at a loss as to what the problem is. Ideas anyone?
If it helps, I can post the full script, but I am just a bit reluctant
to as it is rather long!
Thanks in advance.
Tim
I am attempting to write a dynamic javascript page. There is a button
on the page that when clicked, calls a function that adds some hidden
fields to a form and then submits it. The submit appears to work fine
(i.e. it calls the CGI script), but the query string is empty, using
GET or POST methods. A cut down version of my code is:
function sub() {
var tables =
document.getElementById("outer").getElementsByTagName("table");
var form = document.getElementsByTagName('form')[0];
for (i=0; i<tables.length; i++) {
var columns=i;
var truncs=i;
var links=i;
var sorts=i;
form.appendChild(createTextBox("cols_"+i,columns));
form.appendChild(createTextBox("links_"+i,links));
form.appendChild(createTextBox("truncs_"+i,truncs));
form.appendChild(createTextBox("sorts_"+i,sorts));
}
form.submit();
}
My form definition is:
<form name="theForm" method="get" action="cgi-bin/
create_driver.pl">
</form>
The submit button is created dynamically and calls the sub function
correctly. The submit button is created as a child to theForm.
I am at a loss as to what the problem is. Ideas anyone?
If it helps, I can post the full script, but I am just a bit reluctant
to as it is rather long!
Thanks in advance.
Tim