Click here to Skip to main content
16,021,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

this is what i have:
<form id="loginForm">


<label for="email">User Name</label>
<input id="UserName" type="text" value="" />


<label for="password">Password</label>
<input id="Password" type="password" value="" />

<button id="login" type="button">Login</button>
<script type="text/javascript">
if (document.getElementById("Password").textContent == 'moses')
document.getElementById("login").onclick = function () { location.pathname = "ITEHome.aspx" };
</script>


</form>

after i enter my password, i need the button to redirect to one of two pages in my project CiscoHome.aspx and ITEHome.aspx. the password for CiscoHome.aspx is "teag" and the password for ITEHome.aspx is "moses" and if non of those are entered, Login.aspx should be loaded. ive gotten the redirect to work but not the if statement. any ideas?
Posted
Updated 7-Sep-14 3:16am
v5

1 solution

Check the value in the codebehind (C# code) and then use Response.Redirect[^] to go to the appropriate page.
 
Share this answer
 
Comments
Zieyaad 7-Sep-14 7:05am    
i cant code behind those controls, thats what makes it so messed up

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900