So you aren't showing us real code?
Because *clearly* this <form> is useless:
Code:
<form action="" method="post" name="theform">
It posts back *TO THE SAME PAGE* and it uses method="post", which means that even if we do all that you ask, you will end up sending the following POST data back to this same page:
Code:
http://localhost/dearabby/junk1.html?u=http%3A%2F%2Fyoohoo.com%2Flogin_whatever.php%3Fusername%3Dasdfa+asdf%26password%3DNAX234&submited=Go&username=asdfa+asdf&password=NAX234
Which is (a) illegal because an HTML page can't receive POSTed data and (b) incredibly redundant, because you will be sending the username and password info *TWICE*.
SO... It would help if you would use *REAL* code instead of giving us fake code that is somewhat meaningless.
I would *GUESS* that what you are really after is *SOMETHING* like this:
Code:
<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript">
function doIt(btn, url)
{
var form1 = btn.form;
url += "?username=" + form1.username.value;
url += "&password=" + form1.password.value;
var form2 = document.getElementById("theRealForm");
form2.u.value = url;
form2.submitted.focus();
}
</script>
</head>
<body>
<br><br>
<br><br>
<table align="center" border="0" cellspacing="10">
<tr>
<td align="center" colspan="2">
<form action="somepage.php" method="post" id="theRealForm">
<input type="text" name="u" size="25">
<input type="submit" name="submited" value="Go">
</form>
</td>
</tr>
<form id="dummyForm">
<tr>
<td align="right">Username:</td><td><input type="text" name="username">
</td>
</tr>
<tr>
<td align="right">Password:</td><td><input type="text" name="password">
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="button" name="theform" value="Do URL"
onclick="doIt(this,'http://yoohoo.com/login_whatever.php');">
</form>
</td>
</tr>
</table>
</body>
</html>
Though presumably with all sorts of other stuff you didn't show us.
No?