Http://www.mltang.com/article/840dbc68-7931-4b37-84cf-62cd89f7f31c.html
I want to implement the following functions:
Enter the user name and password to log on to the open a page,
However, when I enter the same user name and password, a new page will not be created (because it has already been opened ).
Could you use JavaScript to do the above? Thank you.
________________________________________________
A:
Use username as the name of the new window opened by Target
____________________________________________________ Answer:
"Use the username as the name of the new window opened by the target"
Can you tell me how to determine that the page has been opened?
____________________________________________________ Answer:
Mywin = Window. open ()
If (mywin! = NULL)
{
Yourcode
}
________________________________________________
A:
In fact, there is no need to make judgments,
In your form
<Form method = "Post" target = "_ blank" Action = "login. php" onsubmit = "javascript: Return presubmit ();">
<Input type = "text" name = "USERSID" value = "">
<Input type = "password" name = "userpwd" value = "">
</Form>
The presubmit function can be defined as follows:
Function presubmit ()
{
If (document. All. USERSID. value = ""){
Alert ("Empty USERSID! ");
Return false;
} Else {
Document.forms%0%.tar get = Document. All. USERSID. value;
Return true;
}
}
After submission, it is submitted to the window of the account you just submitted,
If you change your account, a new window is opened.
________________________________________________
A:
Yes, thanks, close the post!