load part of html using php/jQuery -
i'm trying figure out way load 1 single tab(tabs jquery) without reloading others. issue have submit button , dropdown create new form, , when on new form 'ok' or 'cancel' clicked, has original form back.
the code load part of page found this:
$("#tab-x").load("managetab.php #tab-x");
but know how use in combination $_post variable , submit-button
clarification:
- i have .php(managetab.php) contains several tabs , contents
- i have in each of these tabs dropdown containing database-stored information(code these dropdowns stored in other pages)
- for each of these dropdowns, there exists submit button aditional information out of db based on selection, , put these informations in new form editing
- this new form ideally able submitted without reloading except owning tab.
greetings
<script> $(document).ready(function() { $("#form1").submit(function(){ event.preventdefault(); $.post('data.php',{data : 'dummy text'},function(result){ $("#tab-x").html(result); }); }); }); </script> <form id="form1"> <input id="btn" type="submit"> </form>
Comments
Post a Comment