I am generating the following html form with this php:
echo "<form name=\"userForm\">
Username:
<input type=\"text\" name=\"username\" />
<br />
First name:
<input type=\"text\" name=\"firstname\" />
<br />
Last name:
<input type=\"text\" name=\"lastname\" />
<br />
<input name=\"Submit\" type=\"submit\" value=\"Update\" onclick=\"submitUserInfo();return false\"/>
</form>";
Which is handled by submitUserInfo, which is here:
function submitUserInfo() {
url = "edit_user.php?cmd=submitinfo&username="+document.userForm.username.value+"&firstname="+document.userForm.firstname.value+"&lastname="+document.userForm.lastname.value;
var xmlHttp=GetXmlHttpObject();
if(xmlHttp.responseText == 'true') {
alert(url);
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
//updateByUser(username);
}
}
I clearly have url defined as beginning with
edit_user.php?cmd=submitinfo&username
however when pressing the submit button, it tries to send the url as
edit_user.php?username=
and I cannot figure out why. I have used the above technique succusfully with other forms on my site, and can not find any reason that cmd=submitinfo& is being excluded.