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 4 of 4
  1. #1
    Join Date
    Nov 2008
    Location
    UK
    Posts
    173
    Tokens
    0
    Habbo
    coolchris322

    Latest Awards:

    Default Form with no action

    I was looking on a site the other day and noticed it was using jQuery to load pages, like habbox and my site.

    Now, within one of the pages, I noticed it had a login form, and to submit the form, they used this sort of code

    Code:
    <form action="" method="post">
    Username: <input type="text" name="username"><br>
    Password: <input type="text" name="password"><br>
    <input type="submit" value="Submit">
    </form>
    And when you enter the information, it logs you in and validates you.
    How the hell does it run the log in information and queries while not having a action?

  2. #2
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    A form with an empty action will submit to itself, e.g. a form on randompage.php without an action will use randompage.php as the action.
    I'm not sure how the jQuery stuff is relevant to your question though.

  3. #3
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Chances are they were using jQuery to null any action the form does, and instead add an event listener so when the form is submitted, javascript (jQuery) jumps in, processes the data and does a post AJAX request and then handles the results.


    www.fragme.co = a project.

  4. #4
    Join Date
    Nov 2008
    Location
    UK
    Posts
    173
    Tokens
    0
    Habbo
    coolchris322

    Latest Awards:

    Default

    Dont matter, im using jQuery $.post now.

Posting Permissions

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