0

Hi,

I want to submit the form when click on url without page refresh.

I create url by using some mysql DB values
url like:-
index.php?pid=2&mid=25
index.php?pid=4&mid=34

when click on url

pass the values to another variables But with out page reload.

How to do this?
Any sample link?

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by compusolver
0

The key to your solution is Ajax. Ajax is the process of combining Javascript with the Document Object Model and server-side code or processes.

Essentially, you'll "refresh" only a small part of your page, using obj.innerHTML to display the new content within your defined object.

I don't code for free - so I'm not going to show the process of first sniffing the browser (because IE uses a different DOM than other browsers) and setting everything up and having your form call the function - I'll leave that to you. But the operative part will look like this -

function makerequest(serverPage, objID) {
var obj = document.getElementById(objID);
xmlhttp.open("GET, serverPage);
xmlhttp.onreadystatechange = function() {
  if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
    obj.innerHTML = xmlhttp.responseText;
  }
}
xmlhttp.send(null);
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.