i have a form that need to be proceed in other page, when i try to get value of a input the js return nothing!
the form:
<form id="myf" name="myf" method="POST" action="folder/nextstep.php">
<label for="place">Name: </label>
<input id="place" name="place" type="text" onkeyup="getfind('result_place','folder/nextstep.php','place');"><br>
<div id="result_place"></div>
<script type="text/javascript">
var values = new Array();
values[0] = new Array();
values[0][0] = "place";
values[0][1] = document.getElementById("place").value;
</script>
<input id="submit" name="submit" type="button" onclick="getfind('folder/nextstep.php',values);" value="Add">
</form>
and other file that proceed:
function getfind() {
var xmlobj = ajax();
if (arguments.length == 3) {
//something here
} else if (arguments.length == 2) {
var thepage = arguments[0];
var thevalues = arguments[1];
var theparam = "";
for (var i in thevalues) {
theparam += thevalues[i][0] + "=" + thevalues[i][1] + "&";
alert(theparam);
}
but alert something like this:
place=&input2=& and ...
and the values are empty! why?