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?

Recommended Answers

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 …

Jump to Post

All 2 Replies

you can try using the $_GET with a condition

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);
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.