stop posting the form in new window if login is incorrect(show an error msg instead)
dear readers,
the code below belongs to a form where users can input their username and password to login to their webmail service.
it uses target="_blank" to open the new window for the logged in users. it also opens a new window even if the login information is incorrect. whereas it should be remaining in the current window displaying an error msg "Your login attempt failed!" without opening a new window.
As you can guess, I am not very good in this.
i posted it here cause maybe javascript may be introduced to solve this.
The form has no clue if the data is correct so it will post to a new window.
Only way you can make sure the data is correct is use an Ajax call to post back to the server. If it is, you can call window.open or post the form. If the login is incorrect you show an error message on the page.
Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]