Connecting Tech Pros Worldwide Forums | Help | Site Map

of all the things that drive me crazy...

Newbie
 
Join Date: Mar 2009
Posts: 1
#1: Mar 29 '09
hi..im new to the community and was finally so fustrated with guessing that i figured i'd try to get some help (and from my writing..you can probably tell im not exactly 40 years old)

oki..here's my problem:

i have recently been reorginizing the code in my website...messing with the css and javascript to give it more browser compatability

somehow...in the middle of doing this for several days

i disabled some code that had been previously been working

...onsubmit="checkLogged(username.value,password.v alue); return false;"...

its very simple code which is what drives me most crazy

checkLogged is a function that performs an ajax request to see if the username and password are correct(simply to save the hassle of making the user go to the next page only to find out their information was invalid)....

if the function finds that the information is valid...it submits the page(...forms[0].submit...)..if not...it highlights the boxes in red to suggest the information is incorrect

my problem is that it just keeps submitting and ignoring the "return false;"

the reason i dont just do onsubmit=return checkLogged(...) is because the ajax request doesnt have the true/false result fast enough

btw..the solution has to work with both hitting the submit button or just hitting the enter key

-nick
plz help

thx ahead of time

hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#2: Mar 30 '09

re: of all the things that drive me crazy...


The problem seems to be pretty simple: some mistake in onreadystatechange or checkLogged. But you may need to paste some code to get help.
Reply

Tags
form, html, javascript