Tips on the Web login page: "Create a new page when you enter the same user name and password"

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.