$('#modal .modal-body').html('<form action=\"/portal/ajax_request_demo\" class=\"form-horizontal\" id=\"contact-form\"> \n <p class=\"lead text-center\">Veuillez remplir le court formulaire ci-dessous afin que nous puissions vous contacter.<\/p>\n <input name=\"authenticity_token\" type=\"hidden\" value=\"JE1VfrnXDCa+qQIJ1eqiqjwhKpRVRMNYhBpiV+ddBSw=\" />\n <div class=\"form-group\">\n <label for=\"name\" class=\"col-sm-4 control-label\">Demande :<\/label>\n <div class=\"col-sm-7 \">\n <select class=\"form-control\" name=\"contact_subject\">\n <option value=\"demo\" >Démo en ligne<\/option>\n <option value=\"contact\" selected=\"selected\"> Contact<\/option>\n <\/select>\n <\/div>\n <\/div>\n <div class=\"form-group\">\n <label for=\"name\" class=\"col-sm-4 control-label\">Nom :<\/label>\n <div class=\"col-sm-7 \"><input type=\"text\" name=\"name\" id=\"name\" class=\"form-control\"/><\/div>\n <\/div>\n <div class=\"form-group\">\n <label for=\"company\" class=\"col-sm-4 control-label\">Société :<\/label>\n <div class=\"col-sm-7 \"><input type=\"text\" name=\"company\" id=\"company\" class=\"form-control\"/><\/div>\n <\/div>\n <div class=\"form-group\">\n <label for=\"company\" class=\"col-sm-4 control-label\">Titre :<\/label>\n <div class=\"col-sm-7 \"><input type=\"text\" name=\"title\" id=\"title\" class=\"form-control\"/><\/div>\n <\/div>\n <div class=\"form-group\">\n <label for=\"email\" class=\"col-sm-4 control-label\">E-mail :<\/label>\n <div class=\"col-sm-7 \"><input type=\"text\" name=\"email\" id=\"email\" class=\"form-control\"/><\/div>\n <\/div>\n <div class=\"form-group\">\n <label for=\"phone\" class=\"col-sm-4 control-label\">Téléphone :<\/label>\n <div class=\"col-sm-7 \"><input type=\"text\" name=\"phone\" id=\"phone\" class=\"form-control\"/><\/div>\n <\/div>\n <div class=\"form-group\">\n <label for=\"msg\" class=\"col-sm-4 control-label\">\n Projet / Message :\n <\/label>\n <div class=\"col-sm-7 \"><textarea name=\"msg\" id=\"msg\" class=\"form-control\" rows=\"5\"><\/textarea><\/div>\n <\/div>\n <div class=\"form-group\">\n <div class=\"col-sm-7 col-sm-offset-4\">\n <input type=\"hidden\" name=\"from\" id=\"contact_from\" value=\"contact\" />\n <input type=\"hidden\" name=\"type\" id=\"contact_from\" value=\"contact\" />\n <input type=\"hidden\" name=\"lang\" value=\"fr\" />\n <input type=\"submit\" value=\"Envoyer\" class=\"btn btn-primary\" />\n <\/div>\n <\/div>\n<\/form>\n\n<script>\n\n//callback handler for form submit\n$(\"#contact-form\").submit(function(e)\n{\n var postData = $(this).serializeArray();\n var formURL = $(this).attr(\"action\");\n $.ajax(\n {\n url : formURL,\n type: \"POST\",\n data : postData,\n success:function(data, textStatus, jqXHR) \n {\n //data: return data from server\n },\n error: function(jqXHR, textStatus, errorThrown) \n {\n //if fails \n }\n });\n e.preventDefault(); //STOP default action\n e.unbind(); //unbind. to stop multiple form submit.\n});\n \n\n<\/script>'); $('.modal-title').text(''); $('#modal').modal();