Jump to content
  • 0

Register link for new users


Gigigigi
 Share

Question

Hi. I have a login form which is an authenticated datapage and created a registration form. Upon accessing my website, they will be see the login form but if they are new users, I would like to have a Register' here link and the new users can click it to register however, I don't want to reload the whole page. Basically what I want is once the user click the register link, it will hide the login form and will show the registration form and vice versa. Any suggestion is highly appreciated! :) 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi! You may try the script below: 

 
<html>
<head>
	<title>Test Site </title>
	
</head>
<body>

<a href='javascript:;' onclick='hideAuth();' id="register">Register here</a></br></br>
<a href='javascript:;' onclick='showAuth();' id="login">Login</a></br></br>

/* INSERT EMBED CODE HERE */


<script>

var el = document.getElementById('register');
el.onclick = hideAuth;


function hideAuth() {
  document.querySelector("form[action='URL link Login']").style.visibility="hidden";
  document.querySelector("form[action='URL link Registration']").style.visibility="visible";
   return false;
}

var al = document.getElementById('login');
al.onclick = showAuth;


function showAuth() {
  document.querySelector("form[action='URL link Login']").style.visibility="visible";
  document.querySelector("form[action='URL link Registration']").style.visibility="hidden";
   return false;
}

</script>


</body>
</html>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...