Jquery with php and send mail
I have one question , i have my form working very well with jquery - no
send at the moment - , this jquery works over website with page with his
header , body and footer and many divs inside , this jquery auto call the
same page for send the form and no call external page
My code it´s this :
<script>
jQuery(document).ready(function() {
$("#form1").submit(function(e){
e.preventDefault();
var data = jQuery('#form1').serialize();
jQuery.ajax({
data: data,
cache: false,
url: 'home.php',
type: 'POST',
async:false,
success: function(){
var tit=$("#title_s").val();
var men=$("#mensaje_s").val();
if (tit=="" || men=="")
{
jQuery("#cp_asesor_request_ok").show();
}
else
{
jQuery("#cp_asesor_request_ok").show();
}
}
});
});
});
</script>
**The Form**
<div id="cp_asesor_request_ok" style="display:none;">Form Send</div>
<div id="cp_asesor_request_fail" style="display:none;">Error Send</div>
<form id="form1" name="form1" method="post" action="">
<p>
<label for="textfield"></label>
<input type="text" name="title" id="title_s" class="cp_input_asesor"
value="title" onclick="this.value=''"/>
</p>
<p>
<label for="textarea"></label>
<textarea name="message" id="mensaje_s" class="cp_textarea_asesor"
cols="45" rows="5" title="Insertar Mensaje de Solicitud"></textarea>
<input type="submit" name="button" class="cp_submit_asesor" value="Send" />
</p>
</form>
The question it´s how i can send the email from form because all do from
jquery but how i can call to the php mail function from the same page , i
need yes or yes call to external page for send the email ? or from the
same page called home.php i can send the email , the page it´s home.php
and need call other time to home.php for send email , if no use jquery
it´s easy buut if use jquery how i can do it
Thank´s
No comments:
Post a Comment