Frank Chen a écrit :
Quote:
I try to use this post variable in my php page and nothing is set
inside the variable.
|
With method get (didn't try in php + post)
examples bellow works fine with my browsers
<script type="text/javascript">
function $(id) { return document.getElementById(id); }
function changeAssignedTo(form_name) {
$("assign_to").value = $(form_name).value;
}
</script>
<form action="test.htm" method="get" onsubmit="changeAssignedTo('I_1');">
<input type="text" name="I_1" id="I_1" />
<input type="text" name="I_2" id="I_2" />
<input type="submit" value="GO" />
<input type="hidden" name="assign_to" id="assign_to" />
</form>
or
<script type="text/javascript">
function verif() {
var f = document.forms[0];
for(var i=0; i<f.length; i++)
if(f[i].type=="text")
f['assign_to'].value += escape(f[i].name+'='+f[i].value+'|');
// alert(f.assign_to.value);
return true;
}
</script>
<form action="test.htm" method="get" onsubmit="return verif();">
<input type="text" name="I_1" />
<input type="text" name="I_2" />
<input type="text" name="I_3" />
<input type="submit" value="GO" />
<input type="hidden" name="assign_to" />
</form>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date