Hi all,
I have tried using both DD's Ajax tabs (http://www.dynamicdrive.com/dynamici...tent/index.htm) and Ajax Content (http://www.dynamicdrive.com/dynamici...jaxcontent.htm) scripts to load external content into a DIV on my page. In that DIV, I have a form I'm trying to POST using jquery / ajax. The jquery works on the external page when I access it directly, but when loaded via script into DIV it doesn't. Outcome was identical using either script from DD.
I have tried including the FORM jquery/ajax code in the calling page and/or the external page or both. Also tried with the external page just being the data (DIV and form) and with it being a complete page (HTML and BODY tags). Access page directly and it will ALERT with the form data being submitted (current setup for testing). Submit from Main page and it will submit the page via get (...main.php?field1=TEXT&field2=TEXT).
### Main page (main.php)####
<html>
<head>
<script type="text/javascript" src="ajax/ajaxtabs.js">
/***********************************************
* Ajax Tabs Content script v2.2- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script language="javascript" type="text/javascript" src="script/jquery-1.2.6.min.js"></script>
<script type="text/javascript>
$(document).ready(function() {
$(function() {
$("#submit_button").click(function() {
var dataString = $("#myform").serialize();
alert (dataString);return false; // just display form data as Alert for testing.
return false;
});
});
});
</script>
</head>
<body>
Page Text here
<div id="navigation">
<ul id="resulttabs">
<li><a href="test1.php" class="selected" rel="result_box">Link 1</a></li>
<li><a href="test2.php" rel="result_box">Link 2</a></li>
</ul>
</div>
<div id="result_box"></div>
<script type="text/javascript">
var countries=new ddajaxtabs("resulttabs", "result_box")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
</body>
</html>
====================
### Link 1 Page (test1.php) ###
<div id="data">
<form id="myform" name="myform">
<input type="text" name="field1" id="field1" size="20">
<input type="text" name="field2" id="field2" size="20">
<input type="image" id="submit_button" name="submit_button" src="images/spacer.gif" />
</form>
</div>
====================
Any help is appreciated.
Thanks!



Reply With Quote
Bookmarks