the problem is that the result is opened into a new page, while i want to show it in the same page of the form
I want to precise that i can do it throught javascript, but what i want to know if is it possibile to do it simple changing come parameter of the submit button.
No, HTML cannot do that by itself. It requires either JavaScript or an ASP script that would create the same page and display the user's entry in the search form as well as the results.
My point was that you can't do it with just HTML. You need software of some kind. Whether its ASP, PHP, Perl, Ruby, Java, or JavaScript does not matter. It's probably best to do this in JavaScript and AJAX to keep the original page loaded in the user's browser, but it all depends on which tools you know how to use.
My point was that you can't do it with just HTML. You need software of some kind. Whether its ASP, PHP, Perl, Ruby, Java, or JavaScript does not matter. It's probably best to do this in JavaScript and AJAX to keep the original page loaded in the user's browser, but it all depends on which tools you know how to use.
Many thanks
I'm trying to do it using javascitp + ajax, but i have only one problem at moment... When i press the "submit" button, it retrieve me Error HTTP 404.0 - Not Found
function assegnaXMLHttpRequest()
{
var XHR = null // variabile di ritorno, nulla di default
var browserUtente = navigator.userAgent.toUpperCase(); // informazioni sul nome del browser
// browser standard con supporto nativo non importa il tipo di browser
if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
XHR = new XMLHttpRequest();
// browser Internet Explorer, è necessario filtrare la versione 4
else if( window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0)
{
// la versione 6 di IE ha un nome differente per il tipo di oggetto ActiveX
if(browserUtente.indexOf("MSIE 5") < 0)
XHR = new ActiveXObject("Msxml2.XMLHTTP");
// le versioni 5 e 5.5 invece sfruttano lo stesso nome
else
XHR = new ActiveXObject("Microsoft.XMLHTTP");
}
return XHR;
}
function prova()
{
var str="a"
var xmlhttp=assegnaXMLHttpRequest()
xmlhttp.open("GET","cerca_ragione_sociale.asp?q="+str,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{document.getElementById("txtHint").innerHTML=xmlhttp.responseText;}
}
}
Bookmarks