Note that there are some explanatory texts on larger screens.

plurals
  1. POPosting a form in a div with menu div seperate
    primarykey
    data
    text
    <p>I have a 2 divs one for menu links and the other for content. What I want to be able to do is click a menu link and the page for that menu link to load in the content div.</p> <p>I have already done this and it works. The problem is that the page inside the div contains a a form which does not come up with the success message and the database does not update.</p> <p>All it does is either refresh to main content page or opens current window just as the content page or opens a new window with content page.</p> <p>What solutions are there for this?</p> <h3>Logged_in.php</h3> <p>left div = menu</p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $(".menuLink").click(function(){ $.ajax({ type: "POST", url: $(this).attr('href'), data: "", cache: false, success: function(html){ $("#Middle").html(html); } }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="head"&gt; &lt;div class="lefttop" align="center"&gt; &lt;div class="lefttopleft"&gt; &lt;a class="menuLink" href="Test.php" onclick="return false;"&gt;&lt;img src="Images/logo.jpg" width="94" height="21" /&gt;&lt;/div&gt; </code></pre> <p>When click on that link the page loads into the content div so now that page is showing with a form on in content div what I am having the trouble with is filling form out clicking submit and it updatung the database it just refreshes to main content div or just page loads the the file click on or does so in new window.</p> <h3>Test.php in content div</h3> <pre><code>session_start(); include_once("connect.php"); include_once("functions.php"); if($_POST['WallSubmit'] &amp;&amp; $_POST['Wall']){ $wall = makesafe($_POST['Wall']); mysql_query("INSERT INTO `Wall` (`ID`, `Username`, `MessageBy`, `Date`, `Message`) VALUES ('', '', '$username', '" . time() . "', '$wall')"); } ?&gt; &lt;body&gt; &lt;form method="post"&gt; &lt;table class="default" style="width: 80%" align="center"&gt; &lt;tr&gt; &lt;td class="subheader"&gt;Wall&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="content"&gt;Post a comment.&lt;br /&gt;&lt;textarea name='Wall' id='Wall' style='width: 99%; height: 110px;'&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br/&gt;&lt;center&gt;&lt;input type='submit' value='Post' name='WallSubmit' /&gt;&lt;/center&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;Latest Comments.&lt;/td&gt; &lt;/tr&gt; &lt;/td&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Is there an easy way round this I have looked everywhere?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload