Jump to content

ajax jqeury(data)


azraelGG

Recommended Posts

i need display something on my website when id is set - i get good result but i dont know how to devide .val(data) in 2 variables

if(isset($_POST['proID'])){
		$proID = $_POST['proID'];
		$query = new WP_Query(array('post_type' => 'plodovi', 'p'=>$proID));
		
		while ( $query->have_posts() ) : $query->the_post(); ?>
			<?php echo $mjernaJedinica = types_render_field("mjerna_jedinica", array("show_name"=>""));  ?>
			<?php echo $ekoloskiProizvod = types_render_field("ekoloski_proizvod", array("show_name"=>""));  ?>
			
		<?php endwhile; 
	}

 

and i get my result kg E

 

and now i want that my function is displaying E in one id element and kg in other element

 

 

 

function(data){
				$("#mjernaJedinica").show();
				$("#mjernaJedinica").html(data); 
				$("#inputMjernaJedinica").val(data); // in this id element display kg
				$("#ekoloskiProizvod").val(data);  // in this id element display E
			}

 

when i leave like this  i get it all in one row

Link to comment
https://forums.phpfreaks.com/topic/276221-ajax-jqeurydata/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.