W
Ward
I have a form 'G' with a selectbox and an inputbox.
The selectbox contains 20 usernames.
The inputbox contains a date (=tot). Next to it is a button.
The selectbox uses an onchange event to launch the function jumpoff.
onchange="jumpoff(this, 'gebruiker')";
The inputbox uses an onclick event to invoke the same function.
onclick="jumpoff(document.G.tot,'datum');"
Inside the jumpoff function :
If it is a date then I reorder the dateparts and assign to x.
If it is not I simply assign the value to x.
Notice the alert function : it proves to me that the compounded string is
correct IN BOTH situations, ie I get both
contractsearch.php?usr=gebruiker&geselecteerd=ADR
as well as
contractsearch.php?usr=datum&geselecteerd=20040326
The very same string is used in a location method to call this phpscript.
The phpscript expects the values to arrive using GET.
Here is the problem : it only receives them when the selectbox changes.
If the inputbox/button is used, POST variables arrive in the script.
var_dump proves this :
Using the selectbox, var_dump($_GET) yields as expected
array(2) { ["usr"]=> string(9) "gebruiker" ["geselecteerd"]=> string(3)
"ADR" }
Using the inputbox/button, var_dump($_GET) yields
array(2) { ["tot"]=> string(10) "26/03/2004" ["Submit"]=> string(4)
"Zoek"}. These are POST values.
As I said earlier the alert function gives me this:
contractsearch.php?usr=datum&geselecteerd=20040326
I have no clue.
Thx
Ward
function jumpoff(obj,param) {
var x,y;
if (obj.type=="select-one")
{x=obj.options[obj.selectedIndex].value;}
else
{y=obj.value;
x=y.substr(6,4)+y.substr(3,2)+y.substr(0,2);}
alert ('contractsearch.php?usr='+param+'&geselecteerd='+x);
parent.frames['main'].location='contractsearch.php?
usr='+param+'&geselecteerd='+x;
}
The selectbox contains 20 usernames.
The inputbox contains a date (=tot). Next to it is a button.
The selectbox uses an onchange event to launch the function jumpoff.
onchange="jumpoff(this, 'gebruiker')";
The inputbox uses an onclick event to invoke the same function.
onclick="jumpoff(document.G.tot,'datum');"
Inside the jumpoff function :
If it is a date then I reorder the dateparts and assign to x.
If it is not I simply assign the value to x.
Notice the alert function : it proves to me that the compounded string is
correct IN BOTH situations, ie I get both
contractsearch.php?usr=gebruiker&geselecteerd=ADR
as well as
contractsearch.php?usr=datum&geselecteerd=20040326
The very same string is used in a location method to call this phpscript.
The phpscript expects the values to arrive using GET.
Here is the problem : it only receives them when the selectbox changes.
If the inputbox/button is used, POST variables arrive in the script.
var_dump proves this :
Using the selectbox, var_dump($_GET) yields as expected
array(2) { ["usr"]=> string(9) "gebruiker" ["geselecteerd"]=> string(3)
"ADR" }
Using the inputbox/button, var_dump($_GET) yields
array(2) { ["tot"]=> string(10) "26/03/2004" ["Submit"]=> string(4)
"Zoek"}. These are POST values.
As I said earlier the alert function gives me this:
contractsearch.php?usr=datum&geselecteerd=20040326
I have no clue.
Thx
Ward
function jumpoff(obj,param) {
var x,y;
if (obj.type=="select-one")
{x=obj.options[obj.selectedIndex].value;}
else
{y=obj.value;
x=y.substr(6,4)+y.substr(3,2)+y.substr(0,2);}
alert ('contractsearch.php?usr='+param+'&geselecteerd='+x);
parent.frames['main'].location='contractsearch.php?
usr='+param+'&geselecteerd='+x;
}