I am using the Login object, on initial - first time entry I set the user name / password to the same value (using a csv flat file for data storage).
I want to "Force" the visitor to go on his first visit to a page to change his password.
I added two events - Onclick on the button, like this :
JavaScript function - checkEmail();
Onclick - Link to the relevant page in my project - this works as expected.
My checkEmail(); function is inserted into the HTML page just before the /body> tag, below is the function - but ' after the first login and the password change, the function is again behaving as if the username and password are still equal... WHY? I know they are not equal...
<script type="text/javascript">
function checkEmail()
{
if (loginform.username.value == loginform.password.value)
{
alert('Please update your password and your details');
.....;
} else {
.....;
}
}
</script>
Loging redirection
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/login_basics.html
http://www.wysiwygwebbuilder.com/login_tools.html
TIP:
A lot of information about the login tools can be found in the help/manual.
Also checkout the demo template that is include with the software.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/login_basics.html
http://www.wysiwygwebbuilder.com/login_tools.html
TIP:
A lot of information about the login tools can be found in the help/manual.
Also checkout the demo template that is include with the software.
Re: Loging redirection
Although I cannot teach you how to write code, I doubt that this is correct/reliable:
Shouldn't you use this?
Also note that login happens on the server (via PHP). So the values may not be valid in the browser.
Code: Select all
if (loginform.username.value == loginform.password.value)
Code: Select all
document.getElementById("username").value;
Re: Loging redirection
Well, it seems that the "Remember me" was the problem, maybe the cookies installed on my PC when I checked this option, would like to hear that I am wrong, because I really appreciate the benefit of this option.
Anyway, it now works with a single event on the Submit button - checkEmail();
And, the following JS function does the trick
Thanks Pablo
<script type="text/javascript">
function checkEmail()
{
if (loginform.username.value == loginform.password.value)
{
window.location.href='http://www.nmaa-rc.org.au/editprofile_html.php';
alert('The Password you used is just for first time visitors\rPlease change it and fill in the other details.\r Once you Submit changes - Log in again');
}
else
{
window.location.href='http://www.nmaa-rc.org.au/membershiprenewal.php';
}
}
</script>
Anyway, it now works with a single event on the Submit button - checkEmail();
And, the following JS function does the trick
Thanks Pablo
<script type="text/javascript">
function checkEmail()
{
if (loginform.username.value == loginform.password.value)
{
window.location.href='http://www.nmaa-rc.org.au/editprofile_html.php';
alert('The Password you used is just for first time visitors\rPlease change it and fill in the other details.\r Once you Submit changes - Log in again');
}
else
{
window.location.href='http://www.nmaa-rc.org.au/membershiprenewal.php';
}
}
</script>