I do apologize if this turns into a double post. I though I posted the first time, but I can't find my post to edit and I forgot some code:
The first time I call my function it works like a charm. When I try to call it again, it refuses to work. I know the info is being passed to the function, I checked, but it doesn't initiate the AJAX portion again. do you have to clear the function somehow?
Here's my code for the function:
//the AJAX search function
function searchAndPull(objTNfield, objFNfield, objSTfield, tagID) { //fill variables with Table Name, Field Name, and Search Term (important that tags are id and not name and begin with #)
//fill the variables
tableName = $(objTNfield).val();
fieldName = $(objFNfield).val();
searchTerm = $(objSTfield).val();
$.post('CallFlowScript.php', {
servTN: tableName, //this creates the posts ($_POST['servTN'] and carries the field value
servFN: fieldName, //this creates the posts ($_POST['servFN'] and carries the field value
servST: searchTerm //this creates the posts ($_POST['servST'] and carries the field value
}, function(servDATA) {
$(tagID).html(servDATA); //this fills the specified tag with the returned data
});
} // closes search & pull
And here's the code for my page minus the head and body tags(the function initiates in the header surrounded by a $document.ready(function(){});):
<form id="formSearchNDestroy" method="post">
<div id="callOpen" class="dialogue"><!-- this will populate the call opening script //-->
<input id="coTN" type="hidden" value="call_opening" />
<input id="coFN" type="hidden" value="CALL_OPEN_ID" />
<input id="coST" type="hidden" value="ALL" />
<script>searchAndPull('#coTN', '#coFN', '#coST', '#callOpen');</script>
</div>
<div id="cxVerfiy" class="dialogue">
<input id="cvTN" type="hidden" value="CX_VERIFICATION" />
<input id="cvFN" type="hidden" value="CX_VERIFY_ID" />
<input id="cvST" type="hidden" value="ALL" />
<script>searchAndPull('#cvTN', '#cvFN', '#cvST', '#cvVerfiy');</script>
</div>
<div id="callType"></div>
<div id="callTypeOptions"></div>
<div id="callTypeTasks"></div>
<div id="apptVerify"></div>
<div id="pitchHelper"></div>
<div id="pitchRebuttal"></div>
<div id="planVerify"></div>
</form>
Any help would be appreciated. Even if you point me to the right bit of reference. Thanks.
-Shaun