ashii Posted May 31, 2009 Share Posted May 31, 2009 I juz wana check if the Element value == 'user1' to gimme an alert rediderect to anthr page in the 'body onload 'itself which use to be lykdiz function verify() { if(document.getElementById('txtcheck').value == 'user1') alert("Your Password Has Been Expired Please change your password"); window.location.href="example.htm"; } onload event <body onLoad="verify();> this works perfectly .. but ma probz is..... if the element value is not == 'user1' then it doesnt give me an alert ... but it straightly redirect to the 'example.htm' page but if the page element value is not equal ... it should be in the same page without redirecting ... can u plz help me in this case ???:answerpls::answerpls: Quote Link to comment Share on other sites More sharing options...
.josh Posted May 31, 2009 Share Posted May 31, 2009 maybe if you wrote like a normal human being I'd be able to answer your question. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 31, 2009 Share Posted May 31, 2009 Crayon Violent - what if that is considered 'normal' for him/her? Please post complete code. Example - <body onLoad="verify();> What do you mean that works perfectly? It's missing an ending quote. Quote Link to comment Share on other sites More sharing options...
ashii Posted May 31, 2009 Author Share Posted May 31, 2009 maybe if you wrote like a normal human being I'd be able to answer your question. :D :D Yeah Il Try i have two different php files ....... file no:1 where i get the user input to the element (TextBox) so the moment i click the submit button .... I assign the value of the textbox to a session, continuesly it calls the other PHP file .... in the 2nd PHP file i am having a texbox which has the value of the same session... eg: say that i type ashii in PHP file no1 and submit it..... ashii will be assign to a session, and it will redirect the othe PHP file wich has a text box consisting the value of the session (ashii) hope am normal nw??? K.. nw i come to ma qstion........... when ma 2nd php file loads ....... it will have the session value in the text box .... so if the value of the text box is equal to 'user1' it should give me an alert sayin that "your Welcome". also it should redirect to anthr file/page..... it works perfectly by using ma Script wich i posted previously...... but ma problem is ... it does the same thing when the textbox value is not 'user1'... (it rdeirects to the page without the alert) did u u get me that what i am referring to???? Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 31, 2009 Share Posted May 31, 2009 You need to learn to use proper English grammar. But here's the fix. function verify() { if(document.getElementById('txtcheck').value == 'user1') { alert("Your Password Has Been Expired Please change your password"); window.location.href="example.htm"; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.