SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard billy_111's Avatar
    Join Date
    Jul 2009
    Posts
    1,683
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript Display issue

    Hey,

    Take a look at this page:

    http://www.freemanholland.com/babies/

    I have 2 Divs 'sign-up' and 'sign-up-two' and i use Javascript to display each one depending on the clicking of a link.

    Now When you click on "Already a member? Click here to login", You will see a login box. When you submit the form the page reloads. I want the box to remain showing the login form..

    I tried doing this:

    PHP Code:
    <?
        
    if(isset($_POST['register'])){ ?>
            <script type="text/javascript" language="javascript">
            document.getElementById('sign-up').style.display='none';
            document.getElementById('sign-up-two').style.display='block';
            </script>
        <?
            
    if(isset($_POST['email']) && $_POST['email'] != '' && isset($_POST['password']) && $_POST['password'] != '')
            {
                if(
    User::AuthenticateSiteUser()){
                }else{
                    
    $error "<div class=\"error\">Email or Password incorrect.</div>";
                }
            }
        }
        
    ?>
    But it didn't work..

    Any ideas how i can do this??

    Thanks again
    Software Engineer ASP, ASP.NET, VB, PHP

    Kind regards
    Billy

  2. #2
    SitePoint Member
    Join Date
    May 2010
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use AJAX to do that and to make it easier you can use javascript framework like jQuery or prototypejs

  3. #3
    SitePoint Wizard billy_111's Avatar
    Join Date
    Jul 2009
    Posts
    1,683
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    Software Engineer ASP, ASP.NET, VB, PHP

    Kind regards
    Billy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •