Hi All,
I have a question regarding a javascript function,
can i put an if / else statement inside a function?
more specifically, my problem is this
I am writing a login script which will allow a user to enter username and password, and be allowed access. i also want to be able to give this user the option of entering a 'pin' number, which will also allow access. i have discovered that i can create a new filed using the username and let the user enter their pin here (ie the username is the pin) in which case the password is not required. how do i write this in javascript though?
i have this
( i have posted before with something similar but didnt receive an answer)
I have a question regarding a javascript function,
can i put an if / else statement inside a function?
more specifically, my problem is this
I am writing a login script which will allow a user to enter username and password, and be allowed access. i also want to be able to give this user the option of entering a 'pin' number, which will also allow access. i have discovered that i can create a new filed using the username and let the user enter their pin here (ie the username is the pin) in which case the password is not required. how do i write this in javascript though?
i have this
Code:
<script type="text/javascript">
<!--
function doLogin() {
document.sendin.username.value = document.login.username.value;
document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
document.sendin.submit();
return false;
}
//-->
</script>
( i have posted before with something similar but didnt receive an answer)