PHP won't display dynamic table/form when called by Jquery

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
pizzipie
Forum Commoner
Posts: 87
Joined: Wed Feb 10, 2010 10:59 pm
Location: Hayden. ID

PHP won't display dynamic table/form when called by Jquery

Post by pizzipie »

Within a php program I have the following code which, if you run the program as a stand alone will produce a table/form.
If I call this module, revise.php, from an .html module with: $.post("revise.php", {id: revId, revData: revFlg, dName: dispName}, showResultsFromServer, "json"); the table/form will not be produced. You get a blank screen. Firebug shows the Response as:
generatedSource.png
with no errors. How can I get ths table/form to show??
revise.php run as a standalone you get this:
form_output.png
. The array is produced by php/mysql and is what will be encoded as JSON and sent to the call back function.


Thanks in advance for your help, RP


Code: Select all


foreach($rowsRead[0] as $key => $value) {
	if($value!="") $connectData[$key]=$value;
}

printf("<div id='who'>");

printf("<fieldset class='rev1'>");
printf("<legend>Revising Record %s </legend>", $revId);
printf("<form name='revContactForm' id='revContactForm' method='POST' action=''>\n");
printf("<table class='revForm' border='3' cellpadding='5'  bgcolor='#feede3' ><tr>\n");

printf("<td><input type='text' hidden='hidden' name='revFlg' id='revFlg' value='true'></input></td></tr>\n");
printf("<td><input type='text' hidden='hidden' name='revId' id='revId' value=%s></input></td></tr>\n",$revId);

foreach($rowsRead[0] as $key => $value) {

	if($key=='Name_ID' | $key=='Vendor_ID') {
		continue;
	};
		printf("<td><label for='%s'>%s</label></td>\n",strtolower($key), preg_replace("/_/"," ",$key));
		
		if($key=="Display_Name") {
		
    		printf('<td><input type="text" name="%s" onfocus="showDisplayName();" id="%s" value="%s"></input></td></tr>\n',
    		strtolower($key), strtolower($key), $value);		

			continue;
		};		
		
		
		if (contains($key, "Notes")) {
			printf("<td><textarea name='%s' id='%s'  rows=5 cols=81> '%s' </textarea></td></tr>\n",strtolower($key),
			 strtolower($key), $value);
			continue;
		};
	
		printf("<td><input type='text' name='%s' id='%s' value='%s'></input></td></tr>\n", strtolower($key), strtolower($key), $value);
		
	}; // for each	

printf("<tr><td><input type='submit' class='hov'  name='submit' value='Save Contact Data'></input></td></tr>\n");	
printf("</table></form></fieldset></div>\n");


printf("<div id='inputForm'></div>\n");  // <!-- inputForm -->\n");
     
 
 printf("<div id='controls'>\n");
 
	 //printf("<button type='button' class='hov' name='connect' onclick=window.location.href='ContactFrontEnd.php'>Go Back</button>\n");            
 	//printf("<button type='button' class='hov'  name='savContact' value='Save Contact Data' onclick=saveContact()>Save Contact</button>\n");
 	
  	//printf("<input type='submit' class='hov'  name='submit' id='submit' value='Save Contact Data'></input>\n");	
 printf("</div>\n");
 
 	
printf("<div id='rbox'>\n</div>\n");		
printf("<div id='rbox2'>\n</div>\n");

jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: PHP won't display dynamic table/form when called by Jque

Post by jraede »

Can you show us "showResultsFromServer"? I'm assuming it's a function. Try logging the AJAX response to the console to make sure you're getting one - if so, then it's a problem with that showResultsFromServer function.
lenin14
Forum Newbie
Posts: 1
Joined: Sun Feb 26, 2012 11:55 pm

Re: PHP won't display dynamic table/form when called by Jque

Post by lenin14 »

All exhibition stand construction will be carried out, in-house enabling you to come and inspect, any work in progress, for your peace of mind. We will take care of the complete project management of your exhibition stand, we will liaison with exhibition organizers, submit drawings, risk assessments and method statements and order the site services. A member of our management team will always be on site, to ensure a perfect start, to your show, wherever that may be in the world.
Post Reply