I am having a weird problem. I have a php script that is called by an ajax function that is not placing the html returned the way the data is. Here we go.
<?php // getMemberVideos.php
// Get schedule from the database
include "main.php"; // This is for the id vars only
$db=mysql_connect($hostname, $idname, $idpass) or die(mysql_errno($db).": ".mysql_error($db));
mysql_select_db($sdbname);
// Get the Schedule Table
$sql = sprintf("SELECT category FROM schedule WHERE type = 'Video' ORDER BY category ASC");
I traced the network access in Chrome using the JS console and the returned html from the PHP file is:
"<ul><li><a href=\"#Music\">Music<\/a><\/li><li><a href=\"#Travel\">Travel<\/a><\/li><li><a href=\"#Vehicles\">Vehicles<\/a><\/li><\/ul><div id=\"Music\"><table width=\"98%\" align=\"center\"><tr><td align=\"left\" width=\"30%\"><a href=\"users\/broadcast\/watcher.php?c=6285F178F928&s=uploads\/6285F178F928\/TakilmaRunWork.mp4&p=No\" title=\"This is 3-Gen practicing Takilma Run\"><img align=\"absmiddle\" src=\"http:\/\/itssoezy.com\/uploads\/6285F178F928\/TakilmaRunWork.jpg\" alt=\"ise\" width=\"64\" height=\"64\"><font size=\"2\"> Takilma Run Work Video<\/font><\/a><\/td><td align=\"left\" width=\"55%\"><b><font size=\"2\">This is 3-Gen practicing Takilma Run<\/font><\/b><\/td><td align=\"left\" width=\"15%\"><b><font size=\"2\">Privacy: No<\/font><\/b><\/td><\/tr><\/table><\/div><div id=\"Travel\"><table width=\"98%\" align=\"center\"><tr><td align=\"left\" width=\"30%\"><a href=\"users\/broadcast\/watcher.php?c=TKLM33446655&s=uploads\/TKLM33446655\/IMG_0013.mp4&p=No\" title=\"The California Coast near Santa Barbara From Amtrak coach\"><img align=\"absmiddle\" src=\"http:\/\/itssoezy.com\/uploads\/TKLM33446655\/IMG_0013.jpg\" alt=\"ise\" width=\"64\" height=\"64\"><font size=\"2\"> Coast Starlight<\/font><\/a><\/td><td align=\"left\" width=\"55%\"><b><font size=\"2\">The California Coast near Santa Barbara From Amtrak coach<\/font><\/b><\/td><td align=\"left\" width=\"15%\"><b><font size=\"2\">Privacy: No<\/font><\/b><\/td><\/tr><\/table><\/div><div id=\"Vehicles\"><table width=\"98%\" align=\"center\"><tr><td align=\"left\" width=\"30%\"><a href=\"users\/broadcast\/watcher.php?c=6285F178F928&s=uploads\/6285F178F928\/TL-CLIP0006.MP4&p=No\" title=\"This is my friends Harley I am showing for demo purposes.\"><img align=\"absmiddle\" src=\"http:\/\/itssoezy.com\/uploads\/6285F178F928\/TL-CLIP0006.jpg\" alt=\"ise\" width=\"64\" height=\"64\"><font size=\"2\"> My Friends Harley<\/font><\/a><\/td><td align=\"left\" width=\"55%\"><b><font size=\"2\">This is my friends Harley I am showing for demo purposes.<\/font><\/b><\/td><td align=\"left\" width=\"15%\"><b><font size=\"2\">Privacy: No<\/font><\/b><\/td><\/tr><\/table><\/div>"
Which is exactly what I want. It has the ul for 3 tabs across and then adds the div's for the tabs. When I run this as a standalone it works perfectly! HELP! Maybe I'm too tired and can't see the error. So please need some other eyes.
I used this code in jQuery UI 1.8.18 for autocomplete and it works fairly well.
$(document).ready(function() {
$("#cmntclientnameauto").autocomplete({
minLength: 3,
source: "ajax/clientlist.php",// Pull in names and addresses
select: function( e, ui ){// When we select one
var keyvalue = ui.item.value;
$.post("ajax/readclient.php",{id:keyvalue},
function(data){
// Pull in the data
},"json"
);
}
});
});
This works great I get great looking menu style lists and it selects the info and sends it to readclient.php
Here is clientlist.php to give me the list to select from.
$term = trim(strip_tags($_GET['term']));// Need for the jQuery Autocomplete
// Open the database
$db = mysql_connect($hostname, $idname, $idpass);
if (!$db) die(mysql_errno($db).": ".mysql_error($db)."\n");
mysql_select_db($dbname);
$sql = "SELECT DISTINCT Last_Name, First_Name, Address1, City, Prov_State, Postal, Client_ID, Phone FROM clients WHERE Last_Name LIKE '".$term."%' AND del_flag = 0 ORDER BY Last_Name";
WOW! I have a wierdie and am totally lost. I have everything on my site running jQuery UI 1.9.1 and most of it works good. Autocomplete has some issues and doesn't work, but that's another post.
My problem is when I replaced everything with 1.9.2 it went screwy!
My screen totally disappears and nothing but a refresh will put it back.
The first time (yea I tried it 3 different times) I thought it might be the code I use to load the dom and then put the entire screen up.
First the CSS for that.
body {visibility: hidden;}
All my CSS files being loaded add the media="all" tag to the link
I have an autocomplete list that uses a string to identify the items that is concatenated data
ex: Last_Name, First_Name, Address, etc
When I select from the list. This is the value that is inserted in the autocomplete while the rest of the form is populated correctly. Here's the code.
$(document).ready(function() {
$("#zlhbcustlastname").autocomplete({
minLength: 3,
source: "ajax/clientlist.php",// Pull in names and addresses
select: function( e, ui ){// When we select one
var keyvalue = ui.item.value;
$("#zlhbclientinfo").html(hTxt0+'Please Enter Clients Last Name'+aTxt1);
$.post("ajax/readclient.php",{id:keyvalue},
function(data){
if (data.Black_List != 0) { $("#zlhbclientinfo").html(aTxt0+'Alert: Client is Black Listed'+aTxt1); }
$term = trim(strip_tags($_GET['term']));// Need for the jQuery Autocomplete
// Open the database
include "main.php";
$db = mysql_connect($hostname, $idname, $idpass);
if (!$db) die(mysql_errno($db).": ".mysql_error($db)."\n");
mysql_select_db("treeser");
$sql = "SELECT DISTINCT Last_Name, First_Name, Address1, City, Prov_State, Postal, Client_ID, Phone FROM clients WHERE Last_Name LIKE '".$term."%' ORDER BY Last_Name";
$sql = sprintf("SELECT %s FROM clients WHERE Client_ID = %d",$flds,$cid);
$q0 = mysql_query($sql);
if (!$q0){error_log($sql . ', ' . mysql_errno($db).": ".mysql_error($db),0);}
else {$row = mysql_fetch_array($q0);}
//error_log($row['Last_Name'],0);
echo json_encode($row);
?>
The data.Last_Name field becomes the initial prompt from the selection list. The code all works except for the first field where the list is populated from.
I know this has been asked before. There are all kinds of answers on the web and I can add a row to a table visually. Works great!! But when I query the POST the additions are not in the POST list.
My HTML markup is very simple, the action file has only 1 command when we test: