refresh div not whole page

193 Views Asked by At

Here is my code:

main.php:

<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css">
<div id="TabbedPanels1" class="TabbedPanels" align="left">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Member Group</li>
    <li class="TabbedPanelsTab" tabindex="0">Fine Group</li>
    <li class="TabbedPanelsTab" tabindex="0">Department</li>
    <li class="TabbedPanelsTab" tabindex="0">Member</li>
  </ul>
 <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">  <?php include 'menage member group.php'; ?></div>
    <div class="TabbedPanelsContent"> <?php include 'manage fine group.php'; ?></div>
    <div class="TabbedPanelsContent"> <?php include 'manage department group.php'; ?></div>
    <div class="TabbedPanelsContent"> <?php include 'manage member main.php'; ?></div>
  </div>
</div>
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>

when I click submit button which contain in menage member main.php.the whole page will be refreshed.

2

There are 2 best solutions below

1
On

Look around for AJAX tutorials and you'll find an answer. You can't do this with PHP alone as you'll also need JavaScript or a JavaScript library like jQuery. Good luck :)

0
On

Submit buttons, by design, will have the affect of refreshing the page, unless you use stuff like client side scripting to override this behaviour.

Techniques like AJAX can overcome this feature, although there is still some debate over if it really is as much an issue as it seems.

As a general comment, I'd avoid using spaces in filenames e.g. 'menage member group.php'