azraelGG Posted March 27, 2013 Share Posted March 27, 2013 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 Quote Link to comment Share on other sites More sharing options...
haku Posted March 29, 2013 Share Posted March 29, 2013 Show us the output you want, and the output you are getting. Quote Link to comment Share on other sites More sharing options...
azraelGG Posted April 2, 2013 Author Share Posted April 2, 2013 i need echo out <input id="mjernaJedinica" value="kg" /> <input id="ekoloskiProizvod" value="E" /> this is what i get <input id="mjernaJedinica" value="kg E" /> Quote Link to comment Share on other sites More sharing options...
lilmer Posted April 2, 2013 Share Posted April 2, 2013 If you're passing it to PHP, use explode before returning the value. if I'm not mistaken $result = explode( ' ', $postvalue); var_dump($result); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.