jquery - php and JavaScript zip code -


what i'm trying when user enters zip code in input type value of input type store in origin_zipcode add origin_zipcode inside $url variable. there should run xml , should able display city , state doesn't im trying make work like

https://ship.onemorepallet.com/shipment/start?hsctatracking=296d76b9-a6fc-4140-83f9-de066c986716|9001d544-e760-4dae-ac72-36cc2922be55?utm_referrer=http%3a%2f%2fwww.onemorepallet.com%2f

when enter in zip code

$("#origin_zipcode").keyup(function(){ var origin_zipcode = $("#origin_zipcode").val();  <?php $url = "http://zipcodedistanceapi.redline13.com/rest/gnpsexsqyp3datlkfrb3d0v0mpvc3jjj6zmlwec54fie8ezowasabxaxn5zqpjav/info.xml/origin_zipcode/degree"; $xml = simplexml_load_file($url); $city = $xml->city; $state = $xml->state; ?>  $(".labelzip").text(<?php echo $city,$state"; ?>); }); 

you can't send jquery variable php script unless refresh page using 1 of few possible methods. because while jquery client-side, php server-side. after php has finished loading page, can't used again without page reload.

you can @ these questions possible solutions:


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -