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 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation AJAX POST method problem.....HELP!

    Dear forum guys,
    I'm having a problem regarding the POST method with Ajax.
    I'm sending form inputs through Ajax by POST method to an ASP file to add them back to a database.
    However, what i noticed is that whenever i send the inputs of the form let's say ("username") through Ajax by the POST method, the result is the input "username" however with no spaces.
    Why is it that the Ajax POST method ignores the spaces and sends the inputs without the spaces?
    I tried it with the GET method and found out that GET doesn't ignore the spaces, it worked. But the application that i'm trying to build requires sending bigger data that the GET method can't send. SO therefore i need the POST method but i ran into the problem of Spaces Being Ignored.

    Please, is there a way to send any string that contains spaces through AJAX POST method and not ignore the spaces in the output???

    Thank You
    David

  • #2
    New Coder
    Join Date
    Feb 2005
    Posts
    97
    Thanks
    7
    Thanked 7 Times in 7 Posts
    try encodeURI():

    Code:
    var foo="my test";
    alert(encodeURI(foo));


  •  

    Posting Permissions

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