Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Arrow Send a POST request with ajax code

    I encounter a few websites that has ajax in it's forms which makes me impossible to figure it out how to make a form and submit in a POST request.

    Can anyone help me out?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    Do you mean you *WANT* to use AJAX to do the POST?

    Or you mean you do *NOT* want to use AJAX?

    Without AJAX, it's easy. No JavaScript needed:
    Code:
    <form action="somesite.com/somepage.php" method="POST">
    (that shows PHP on the server, but it could be JSP, ASP, CGI, etc.)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Old Pedant View Post
    Do you mean you *WANT* to use AJAX to do the POST?

    Or you mean you do *NOT* want to use AJAX?
    I don't want to use ajax but the page has ajax

    Here is an example for a normal form

    Code:
    <form method="post" action="https://www.site.com/index.php">
    <input type="text" name="username" value="MyCoolName">
    <input type="text" name="password" value="EvenCoolerPassword">
    <input type="submit" name="signin" value="Sign In">
    </form>
    The problem is that it has ajax in the code ex: #call and shows the waiting circle tipical when the browser is making a push in ajax.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    So remove the AJAX code.

    If you mean this is not YOUR page, though, then that may be very hard to do and maybe can't be done with JavaScript, alone.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    tribalmp (05-12-2013)


  •  

    Posting Permissions

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