Awattyavaitle
New Member
For some reason this does not work. I have copy/paste the code, but it goes to the html-echo.php rather than displaying the result in the htmlExampleTargetWhat am I doing wrong here.ThanksDaveedit: sorry guys - here is the url - http://jquery.malsup.com/form/#html\[code\] <script src="http://stackoverflow.com/questions/2063063/js/jquery-1.3.2.js" type="text/javascript" language="javascript"></script><script type="text/javascript">// prepare the form when the DOM is ready $(document).ready(function() { // bind form using ajaxForm $('#htmlForm').ajaxForm({ // target identifies the element(s) to update with the server response target: '#htmlExampleTarget', // success identifies the function to invoke when the server response // has been received; here we apply a fade-in effect to the new content success: function() { $('#htmlExampleTarget').fadeIn('slow'); } }); });</script><div style="position:absolute; top:129px; left: 400px; width:500px; border:#000000 thin solid;"> <form id="htmlForm" action="submit_form.php" method="post"> Message: <input type="text" name="message" value="http://stackoverflow.com/questions/2063063/Hello HTML" /> <input type="submit" value="http://stackoverflow.com/questions/2063063/Echo as HTML" /> </form>Reply: <div id="htmlExampleTarget"></div> </div>\[/code\]and on the submit-form.php page \[code\]echo '<div style="background-color:#ffa; padding:20px">' . $_POST['message'] . '</div>'; \[/code\]