Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7
  1. #1
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default Should this work?

    Ok, i'm using javascript to login, heres my codes:
    HTML Code:
                        <div id="bth_login">
                            <form id="bth_login" name="bth_login" action="javascript: bthlogin();" method="post">
                                <p><strong>Username</strong>:<br>
                                    <input type="text" name="username" id="username" size="20"></p>
                                <p><strong>Password</strong>:<br>
                                    <input type="password" name="password" id="password" size="20"></p>
                                <p><input type="submit" value="Submit" name="submit"></p>
                            </form>
                        </div> 
    JavaScript:
    HTML Code:
                function bthlogin()
                {
                    username = document.getElementById('username').value;
                    password = document.getElementById('password').value;
                    $('bth_login').innerHTML = '<img src="images/loading.gif" />';
                    new Ajax.Request('login.php',
                    {
                        parameters: {username: username, password: password},
                        onSuccess: function(send)
                        {
                            $('bth_login').innerHTML = send.responseText;
                        }
                    });
                }
    Should that work?

  2. #2
    Join Date
    Mar 2008
    Posts
    940
    Tokens
    75

    Default

    by the looks of your code it should work. Only one way to find out.


  3. #3
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Turbocom View Post
    by the looks of your code it should work. Only one way to find out.
    Its not working for me

  4. #4
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Turbocom View Post
    by the looks of your code it should work. Only one way to find out.
    He wants to know if it will or not, not somebody thinking they think it should work because they don't even know javascript for a start.

    @ Jack:

    Code:
    new Ajax.Request('login.php')
    You didn't close the bracket.

  5. #5
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Calon View Post
    He wants to know if it will or not, not somebody thinking they think it should work because they don't even know javascript for a start.

    @ Jack:

    Code:
    new Ajax.Request('login.php')
    You didn't close the bracket.
    Its suppose to be like that
    The close bracket is further down.

    I found the problem, I forgot Ajax.Request was to do with prototype

    So its working now

  6. #6
    Join Date
    Mar 2008
    Posts
    940
    Tokens
    75

    Default

    Quote Originally Posted by Calon View Post
    He wants to know if it will or not, not somebody thinking they think it should work because they don't even know javascript for a start.

    @ Jack:

    Code:
    new Ajax.Request('login.php')
    You didn't close the bracket.
    Calon now I know why more and more people dislike you. -.-


  7. #7
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Yeah agreed, unnecessary post.

    You got it wrong too... :rolleyes:


Posting Permissions

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