I have to load 2 versons of jquery in order for an onclick event and a form post event. The onclick event works ok with calling http code.jquery.com/jquery-latest.min.js but the post event will not work unless i call http code.jquery.com/jquery-1.4.2.min.js and http://code.jquery.com/ajax/jquery.validate/1.7/jquery.validate.min.js But i have to use the noConflict in order to get things to work.
The call for the latest.min works my onclick event to load into a div The call for the submitHandler: function(form) works my form post which loads into another div.
The menu is operated by the onClick event and loads the correct menu into the top bar. The user then selects from a drop down in that menu to load the form into another div below.
The form gets posted and displays a result for me in the div that the form is in and reloads the form.
The form that is loaded into the div also has the code for the form to work.
The problem is after it has worked once, if you try to post the same form that has loaded again (identical as the first including the code for posting the form) it fails to post
script used for posting form
$.noConflict();
$(document).ready(function () {
$("#ncus").validate({
debug: false,
submitHandler: function (form) {
$.post('../AddCusForm/process_form.php', $("#ncus").serialize(), function (data) {
$('#mainBody').html(data);
$("#mainBody").find("script").each(function (i) {
eval($(this).text());
});
$("form#ncus")[0].reset();
});
}
});
});
The process form that is being loaded into the same div has the identical code as above. and replaces the original form with another form (Same name)