simple ajax problem, help

Discussion in 'JavaScript' started by cosminx2003, Jul 22, 2008.

  1. #1
    Hi, i did a php tool and i want to show the results with ajax.
    Here i have a part of ajax code :
       function get(obj) {
          var poststr = "mytextarea1=" + escape(encodeURI( document.getElementById("results").value )) +
                        "&mytextarea2=" + escape(encodeURI( document.getElementById("extension").value )) +
                        "&mytextarea3=" + escape(encodeURI( document.getElementById("no").value )) +
                        "&mytextarea4=" + escape(encodeURI( document.getElementById("kind").value )) +
                        "&mytextarea5=" + escape(encodeURI( document.getElementById("cv").value ));
          makePOSTRequest('do.php', poststr);
       }
    Code (markup):
    a php code :
    results id is <input> and extension is <select>, when i run the form it shows me only $_POST['results'] variable.
    I think the problem it's on ajax, maybe i wrong ids definition.
    Please help me.
     
    cosminx2003, Jul 22, 2008 IP
  2. cosminx2003

    cosminx2003 Active Member

    Messages:
    581
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    nobody knows? :eek:
     
    cosminx2003, Jul 22, 2008 IP
  3. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You should use encodeURIComponent, not encodeURI.
     
    MMJ, Jul 23, 2008 IP
  4. cosminx2003

    cosminx2003 Active Member

    Messages:
    581
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #4
    IT's not working..
     
    cosminx2003, Jul 23, 2008 IP
  5. cosminx2003

    cosminx2003 Active Member

    Messages:
    581
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #5
    i made it works...
     
    cosminx2003, Jul 23, 2008 IP