php - activity 1 shows POST result, activity 2 does not. Explanation? -
the question is: please explain why code works in 1 activity, won't in second?
just note: query absolutely fine. i've echo'd query in both occasions , correct.
i load page. works.
i start "activity 1", filter through database specific search term.
my javascript:
$('#filter').on("click", function(e) { e.preventdefault(); $( "#dialog-filter" ).dialog( "open" ); }); $( "#dialog-filter" ).dialog({ autoopen: false, resizable: false, height: 100, modal: true });
my html
<div id="dialog-filter" title="filter op"> <form id="form_filter" name="form_filter" action="" method="post"> <input type="hidden" name="filter" id="filter" value="filter" /> <table align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td>number:</td> <td> <input name="number" size="10" type="text" id="number" class="text ui-widget-content" title="press enter after filling in term" /> </td> </tr> </table> </form> </div>
i surprised find out worked , didn't need code post action after "ok" button, had do. didn't complain, since worked.
i recreated activity on same page again else (but dialog). still no problems.
activity 2: wished recreate activity 1 didn't wish use dialog time. there click event , when pressed, send post request term , result result of condition.
$('#activate').on("click", function(e) { e.preventdefault(); if(active== true){ $.post("/views/fin/queries/investering.php", { "activate": active} ); active= false; }else{ $.post("/views/fin/queries/investering.php"); active= true; } });
the variable active gets declared , it's merely there able switch between "all" list , "only containing this" list. page won't reload, because never specified this, didn't have "activity 1". i'm wondering why won't work second time way.
if happen know should writing instead in activity 2, you're welcome post suggestions.
if haven't supplied enough information, or seems rather confusing, let me know. i'll glad try , explain other way.
thanks in advance.
Comments
Post a Comment