473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

GET and POST mixed up ??

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;
}
Jul 20 '05 #1
1 1546
Ward <ki************@for.president.com> wrote in
news:Xn**********************************@195.130. 132.70:
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;
}


Still don't know what causes this, but worked around it by modifying the
receiving script so that it anticipates POST data as well.
Everything works now.

The htmlform is actually quite complex, with numerous forms that use
post, get, javascript and "absense of action" techniques to pass data to
other scripts (or itself).
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Perttu Pulkkinen | last post by:
No questions, but just consider if this is useful to you:-) but of course feedback & corrections are welcome. function php_mixed_to_js_value($jsname, $mixed) { if(is_null($mixed)) { return "\n...
2
by: Paul A. Hoadley | last post by:
Hello, I am trying to convert a RELAX NG schema to DTD using Trang. I am currently trying to add some inline elements to the schema, such as <emph> for marking emphasised text. Here is an...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
8
by: Nadav | last post by:
Hi, I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid...
7
by: Staale L. Hansen | last post by:
We have an application which uses some mixed-mode code to expose a .NET 1.1 managed API. Only the necessary files are compiled with /clr. We want to be able to load the application without .NET...
0
by: samsonfr | last post by:
Hello, I have read KB 814472 and the article "How To: Remove Dependency on _vcclrit.h" (http://msdn2.microsoft.com/en-us/library/ms173267(en-us,vs.80).aspx) which confirmed that VS.NET 2005...
3
by: Mali Guven | last post by:
Hello, I have a native DLL (written in C) which is supposed to call a managed DLL (was written in C#, and an entry point was injected modifying the ildasm'd code). The exectuable calls the...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
0
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.