Perfect.
But now I have another issue.
That I use a contact form with this template "as I put the <form></form> inside the template" and this form is calling 3 js files
(script.js, jquery.jqtransform.js and jquery.validationEngine.js) ,ok...
The form is using ajax, jquery and php. when submit the form, it must call submit.ajax "load javascript"
and if the javascript didn't load, it will load directly the php instead of the js.
So, when I submit the form it call directly php which is not good for me, I need to validate the form before submit and submit the form without refresh the page "as it did when it happen by using php".
Referring to my question above, how to make the three js files call the submit form that has included in the jquery template? "The files are loaded but the script is not working"
................
Example for the script.js file:
$(document).ready(function(){
$('#contact-form').jqTransform();
$("button").click(function(){
$(".formError").hide();
});
var use_ajax=true;
$.validationEngine.settings={};
$("#contact-form").validationEngine({
inlineValidation: false,
promptPosition: "centerRight",
success : function(){use_ajax=true},
failure : function(){use_ajax=false;}
})
$("#contact-form").submit(function(e){
if(!$('#subject').val().length)
{
$.validationEngine.buildPrompt(".jqTransformSelectWrapper","* This field is required","error")
return false;
}
if(use_ajax)
{
$('#loading').css('visibility','visible');
$.post('submit.php',$(this).serialize()+'&ajax=1',
function(data){
if(parseInt(data)==-1)
$.validationEngine.buildPrompt("#captcha","* Wrong verification number!","error");
else
{
$("#contact-form").hide('slow').after('<h1>Thank you!</h1>');
}
$('#loading').css('visibility','hidden');
}
);
}
e.preventDefault();
})
});
..........
Really I appreciate your help.
Thanks.