$(function() { var txt_action = "Your I wish to is required"; var txt_name = "Please, type your name"; var txt_surname = "Please, type your surname(s)"; var txt_email = "Please, type your email address correctly"; $(".button").click(function() { // validate and process form // first hide any error messages var i_wish = $("input#txt_other_action").val(); if (i_wish == "") { alert(txt_action); $("input#txt_other_action").focus(); return false; } var name = $("input#txt_name").val(); if (name == "") { alert(txt_name); $("input#txt_name").focus(); return false; } var surname = $("input#txt_surname").val(); if (surname == "") { alert(txt_surname); $("input#txt_surname").focus(); return false; } var email = $("input#txt_email").val(); if (email == "") { alert(txt_email); $("input#txt_email").focus(); return false; } // conformo el nombre del usuario var user_name = $("#cbx_title").val() + " " + name; if (surname != "") user_name = user_name + " " + surname; var dataString = 'txt_other_action='+ i_wish + '&txt_name=' + name + '&txt_surname=' + surname + '&txt_email=' + email + '&cbx_title=' + $("select#cbx_title").val() + '&txt_comments=' + $("textarea#txt_comments").val() + '&product_type=' + $("input#product_type").val() + '&cbx_action=' + $("input#cbx_action").val() + '&site_name=' + $("input#site_name").val() + '&txt_telephone=' + $("input#txt_telephone").val() + '&txt_antispam_validation=' + $("input#txt_antispam_validation").val() + '&include_localization=' + $("input#include_localization").val() + '&footer=' + $("input#footer").val(); $.ajax({ dataType: "jsonp", url: "http://www.fast-manager.com/comun/web_services/send_contact_email.asp?method=?", data: dataString }); $('#contact_us_form').html("

Dear " + user_name + "

Thank you for contacting " + $("input#site_name").val() + ", a website operated by Cuba Travel Network.com.

The following is a summary of your inquiry:

I wish: Other - " + i_wish + "
Name: " + user_name + "
Email: " + email + "
Telephone: " + $("input#txt_telephone").val() + "
Comments:
" + $("textarea#txt_comments").val() + "

We will respond to your inquiry within one business day.

"); return false; }); });