Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP Example - AJAX and XML

<html>
<head>
<script>
function showCD(str) {
  if (str=="") {
    document.getElementById("txtHint").innerHTML="";
    return;
  }
  var xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=function() {
    if (this.readyState==4 && this.status==200) {
      document.getElementById("txtHint").innerHTML=this.responseText;
    }
  }
  xmlhttp.open("GET","getcd.php?q="+str,true);
  xmlhttp.send();
}
</script>
</head>
<body>

<form>
Select a CD:
<select name="cds" onchange="showCD(this.value)">
  <option value="">Select a CD:</option>
  <option value="Bob Dylan">Bob Dylan</option>
  <option value="Bee Gees">Bee Gees</option>
  <option value="Cat Stevens">Cat Stevens</option>
</select>
</form>
<div id="txtHint"><b>CD info will be listed here...</b></div>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: flash message laravel for incorrect password 
Php :: php convert dbf to mysql 
Php :: php mail merge docx document 
Php :: preared request pdo 
Php :: data XML 
Php :: merge multiple exceptions php 
Php :: PHP create array of specified size 
Php :: undefined index / error reporting in php 
Php :: php get non unique values from array 
Php :: @forelse laravel 
Php :: Get a link to a record or page in any language version (Polylang) 
Php :: compare in wp 
Php :: function placing bet using php 
Php :: laravel event on attribute chang 
Php :: How to send JSON format data in postman to django models that have a foreign key to another model 
Php :: laravel 8 remove public folder from url 
Php :: how can get attribute without getter in laravel 
Php :: featured image tab not displayed on post 
Php :: parameterize constructor mpdf php 
Php :: wc get_image() return image url 
Php :: imprimir texto en php 
Php :: laravel collection makeVisible 
Php :: wp+ theme translate 
Php :: php debug backtrace last function 
Php :: wordpress redirect attachment page to file 
Php :: Yii2 GridView Filtering on Relational Column 
Php :: symfony postgresql 
Php :: google calendar api push notifications php 
Php :: laravel rename file ftp 
Php :: Verifying session info 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =