D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
proc
/
self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
script.js
back
Copy
//Getting value from "ajax.php". function fill(Value) { //Assigning value to "search" div in "search.php" file. $('#search').val(Value); //Hiding "display" div in "search.php" file. $('#display').hide(); if (Value=="") { document.getElementById("txtitem").innerHTML=""; return; } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (this.readyState==4 && this.status==200) { // document.getElementById("txtitem").innerHTML=this.responseText; //alert(this.responseText); var str1 = JSON.parse(this.responseText); // alert(this.responseText); //alert(str1.id); document.getElementById("price").value = str1.selling_price; document.getElementById("tax").value = str1.tax; document.getElementById("discount_applied").value = str1.discount_applied; document.getElementById("discount_category").value = str1.discount_category; } } xmlhttp.open("GET","getitem.php?q="+Value,true); xmlhttp.send(); } $(document).ready(function() { $("#search").keyup(function() { var name = $('#search').val(); if (name == "") { $("#display").html(""); } else { $.ajax({ type: "POST", url: "ajax.php", data: { search: name }, success: function(html) { $("#display").html(html).show(); } }); } }); });