From be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 20 Dec 2009 18:38:08 +0000 Subject: Test. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- ajax/form_suggestions/clienthint.js | 45 +++++++++++++++++++++++ ajax/form_suggestions/gethint.php | 71 +++++++++++++++++++++++++++++++++++++ ajax/form_suggestions/index.htm | 14 ++++++++ 3 files changed, 130 insertions(+) create mode 100644 ajax/form_suggestions/clienthint.js create mode 100644 ajax/form_suggestions/gethint.php create mode 100644 ajax/form_suggestions/index.htm (limited to 'ajax/form_suggestions') diff --git a/ajax/form_suggestions/clienthint.js b/ajax/form_suggestions/clienthint.js new file mode 100644 index 0000000..408c220 --- /dev/null +++ b/ajax/form_suggestions/clienthint.js @@ -0,0 +1,45 @@ +var xmlhttp + +function showHint(str) +{ +if (str.length==0) + { + document.getElementById("txtHint").innerHTML=""; + return; + } +xmlhttp=GetXmlHttpObject(); +if (xmlhttp==null) + { + alert ("Your browser does not support XMLHTTP!"); + return; + } +var url="gethint.php"; +url=url+"?q="+str; +url=url+"&sid="+Math.random(); +xmlhttp.onreadystatechange=stateChanged; +xmlhttp.open("GET",url,true); +xmlhttp.send(null); +} + +function stateChanged() +{ +if (xmlhttp.readyState==4) + { + document.getElementById("txtHint").innerHTML=xmlhttp.responseText; + } +} + +function GetXmlHttpObject() +{ +if (window.XMLHttpRequest) + { + // code for IE7+, Firefox, Chrome, Opera, Safari + return new XMLHttpRequest(); + } +if (window.ActiveXObject) + { + // code for IE6, IE5 + return new ActiveXObject("Microsoft.XMLHTTP"); + } +return null; +} \ No newline at end of file diff --git a/ajax/form_suggestions/gethint.php b/ajax/form_suggestions/gethint.php new file mode 100644 index 0000000..8cb7379 --- /dev/null +++ b/ajax/form_suggestions/gethint.php @@ -0,0 +1,71 @@ +0 +if (strlen($q) > 0) + { + $hint=""; + for($i=0; $i \ No newline at end of file diff --git a/ajax/form_suggestions/index.htm b/ajax/form_suggestions/index.htm new file mode 100644 index 0000000..c2fc742 --- /dev/null +++ b/ajax/form_suggestions/index.htm @@ -0,0 +1,14 @@ + + + + + + +
+First Name: +
+ +

Suggestions:

+ + + \ No newline at end of file -- cgit