I'm trying to open a new window, and fill in 2 fields. I can't show you my exact problem, but I've created another example and have the same problem.
The window opens fine, but the fields are not filled in, and I think part of the problem is that the form doesn't have a name, and I don't have control over the file to give it one.
This is the form I am trying to fill in...
Code: Select all
<form method="post" action="loginurlhere">
<table align=center width="100" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="129">UserName:</td>
<td width="371">Password:</td>
</tr>
<tr>
<td width="129">
<input type="text" name="username" size="12" maxlength="12" />
</td>
<td width="371">
<input type="password" name="password" size="12" maxlength="12" />
</td>
</tr>
<tr>
<td width="129">
<div align="right">
<input type="reset" name="Reset" value="Reset" class="button">
</div>
</td>
<td width="371">
<input type="submit" name="Submit2" value="Submit" class="button">
</td>
</tr>
<tr>
<td width="129"> </td>
<td width="371"> </td>
</tr>
</table>
</form>Code: Select all
<script language=Javascript>
function openlogin(user,pass) {
window.open( 'pageurlhere', 'newwindow', 'top=80,left=60,width=400,height=600' );
newwindow.document.form.username.value = $user;
newwindow.document.form.password.value = $pass;
}
</script>Thanks,
Josh