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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -