php - page reload and send post to himself -


i have php page have $id=$_get['id']; want make select box when click on option reload page (with + new value number in post).

i did that:

function test(){     var id="<?= $id?>";     $("#box").bind("change", function() {         var val = $(this).val();         $.ajax({             url: '/somepage.php?id='+id,             type: 'post',             data: {f: val}         });     }); } 

now don't (or , dont see it..)

if want reload page why need ajax assuming $id $_get['id'] this

function test(){ var id="<?= $id?>"; $("#box").bind("change", function() {     var val = $(this).val();       var newval = parseint(val)+parseint(id);        window.location.href='somepage.php?id='+newval; }); } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -