tags:

views:

31

answers:

1

Question: I have one popup window it contains some values in textbox and textarea. I need to submit the value to server without closing the popup window.

Is there any way....

Thanks in Advance

+1  A: 

Yes, use Ajax with POST:

var url = "get_data.php";
var params = "lorem=ipsum&name=binny";
http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Call a function when the state changes.
    if(http.readyState == 4 && http.status == 200) {
        alert(http.responseText);
    }
}
http.send(params);

I would also add that you should be able to do a regular POST via form in the popup without closing it anyway. Its just another browser window...

michael