Page contact - Non réception de toutes les coordonnées du client

depaninf Messages postés 154 Statut Membre -  
depaninf Messages postés 154 Statut Membre -
Bonjour,

Depuis quelques temps, lorsqu'un client m'envoie un message via ma page de contact, je reçois bien son message et son adresse mail mais plus son nom ni son numéro de téléphone que pourtant il a obligatoirement donné pour pouvoir expédier le message.

Quelqu'un peut il m'aider ? Merci d'avance

Voici ma page "rd-mailform.
Code :
<?php
 
$recipients = 'monadressemail';
//$recipients = '#';
 
try {
    require './phpmailer/PHPMailerAutoload.php';
 
    preg_match_all("/([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)/", $recipients, $addresses, PREG_OFFSET_CAPTURE);
 
    if (!count($addresses[0])) {
        die('MF001');
    }
 
    if (preg_match('/^(127\.|192\.168\.)/', $_SERVER['REMOTE_ADDR'])) {
        die('MF002');
    }
 
    $template = file_get_contents('rd-mailform.tpl');
 
    if (isset($_POST['form-type'])) {
        switch ($_POST['form-type']){
            case 'contact':
                $subject = 'A message from your site visitor';
                break;
            case 'subscribe':
                $subject = 'Subscribe request';
                break;
            case 'order':
                $subject = 'Order request';
                break;
            default:
                $subject = 'A message from your site visitor';
                break;
        }
    }else{
        die('MF004');
    }
 
    if (isset($_POST['email'])) {
        $template = str_replace(
            ["<!-- #{FromState} -->", "<!-- #{FromEmail} -->"],
            ["Email:", $_POST['email']],
            $template);
    }else{
        die('MF003');
    }
 
    if (isset($_POST['message'])) {
        $template = str_replace(
            ["<!-- #{MessageState} -->", "<!-- #{MessageDescription} -->"],
            ["Message:", $_POST['message']],
            $template);
    }
 
    preg_match("/(<!-- #{BeginInfo} -->)(.|\n)+(<!-- #{EndInfo} -->)/", $template, $tmp, PREG_OFFSET_CAPTURE);
    foreach ($_POST as $key => $value) {
        if ($key != "email" && $key != "message" && $key != "form-type" && !empty($value)){
            $info = str_replace(
                ["<!-- #{BeginInfo} -->", "<!-- #{InfoState} -->", "<!-- #{InfoDescription} -->"],
                ["", ucfirst($key) . ':', $value],
                $tmp[0][0]);
 
            $template = str_replace("<!-- #{EndInfo} -->", $info, $template);
        }
    }
 
    $template = str_replace(
        ["<!-- #{Subject} -->", "<!-- #{SiteName} -->"],
        [$subject, $_SERVER['SERVER_NAME']],
        $template);
 
    $mail = new PHPMailer();
    $mail->From = $_SERVER['SERVER_ADDR'];
    $mail->FromName = $_SERVER['SERVER_NAME'];
 
    foreach ($addresses[0] as $key => $value) {
        $mail->addAddress($value[0]);
    }
 
    $mail->CharSet = 'utf-8';
    $mail->Subject = $subject;
    $mail->MsgHTML($template);
 
    if (isset($_FILES['attachment'])) {
        foreach ($_FILES['attachment']['error'] as $key => $error) {
            if ($error == UPLOAD_ERR_OK) {
                $mail->AddAttachment($_FILES['attachment']['tmp_name'][$key], $_FILES['Attachment']['name'][$key]);
            }
        }
    }
 
    $mail->send();
 
    die('MF000');
} catch (phpmailerException $e) {
    die('MF254');
} catch (Exception $e) {
    die('MF255');
}
 
?>


et ma page "jquery-rd-mailform.min.js":

!function(e){function t(i,o){this.options=e.extend({},t.Defaults,o),this.$element=e(i),this._plugins={},this._handlers={"mf.success mf.fail":e.proxy(this.update,this),"mf.process":e.proxy(this.process,this),reset:e.proxy(this.reset,this)},e.each(t.Plugins,e.proxy(function(e,t){this._plugins[e[0].toLowerCase()+e.slice(1)]=new t(this)},this)),this.initialize()}var i;i={MF000:"Envoyé",MF001:"La case n'est pas cochée !",MF002:"Form will not work locally!",MF003:"Please, define email field in your form!",MF004:"Please, define type of your form!",MF254:"Something went wrong with PHPMailer!",MF255:"Aw, snap! Something went wrong."},t.Defaults={baseClass:"rd-mailform"},t.Plugins={},t.prototype.initialize=function(){this.$element.trigger("mf.initialize"),this.$element.addClass(this.options.baseClass).trigger("reset"),this.create(),this.watch(),this.$element.trigger("mf.initialized")},t.prototype.create=function(){},t.prototype.watch=function(){var e=this;e.$element.ajaxForm({beforeSubmit:function(){e.$element.trigger("mf.process")},error:function(t){e.$element.trigger("mf.fail",{code:t,message:i[t]})},success:function(t){console.log(t),"MF000"==t?e.$element.trigger("mf.success",{code:t,message:i[t]}):(t=5==t.length?t:"MF255",e.$element.trigger("mf.fail",{code:t,message:i[t]}))}}).on(this._handlers)},t.prototype.process=function(){this.$element.addClass("process")},t.prototype.update=function(t,i){this.$element.removeClass("process"),this.$element.addClass("MF000"===i.code?"success":"fail"),setTimeout(e.proxy(function(){this.$element.trigger("reset")},this),3e3)},t.prototype.reset=function(){this.$element.removeClass("success"),this.$element.removeClass("fail"),this.$element.trigger("mf.reset")},e.fn.rdMailForm=function(i){return this.each(function(){e(this).data("rdMailForm")||e(this).data("rdMailForm",new t(this,i))})},e.fn.rdMailForm.Constructor=t}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Validator=function(i){this._core=i,this._handlers={"mfValidator.validate":this.validate,"mfValidator.error":this.error,"mfValidator.valid":this.valid,"mfValidator.reset":this.reset,"mfValidator.click":e.noop()},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={validator:{applyTo:"[data-constraints]","class":"mfValidation",constraints:{"@LettersOnly":{rule:"^([a-zA-Zа-яА-ЯіїёІЇЁєЄҐґ\\s]{0,})$",message:"N'utilisez que des lettres !"},"@NumbersOnly":{rule:"^-?\\d*\\.?\\d*$",message:"N'utilisez que des chiffres !"},"@NotEmpty":{rule:"([^\\s])",message:"Le champs ne doit pas être vide !"},"@Email":{rule:"^(([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)){0,}$",message:"Entrer une adresse mail valide !"},"@Phone":{rule:"^(\\+?\\d{0,3}\\s*\\(?\\d{1,3}\\)?\\s*\\d{3}\\s*\\d{4}){0,}$",message:"Entrer un numéro de téléphone valide !"},"@Date":{rule:function(e){return navigator.userAgent.match(/(iPod|iPhone|iPad)/)?!0:new RegExp("^($)|(((0[13578]|10|12)(-|\\/)((0[1-9])|([12])([0-9])|(3[01]?))(-|\\/)((19)([2-9])(\\d{1})|(20)([01])(\\d{1})|([8901])(\\d{1}))|(0?[2469]|11)(-|/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|/)((19)([2-9])(\\d{1})|(20)([01])(\\d{1})|([8901])(\\d{1}))))$").test(e.val())},message:"Use MM/DD/YYYY format!"},"@SelectRequired":{rule:function(e){return 0!==e.find("option:selected").index()},message:"Merci de choisir une option !"}}}},t.prototype.initialize=function(){this._core.$element.trigger("mfValidator.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfValidator.initialized")},t.prototype.create=function(){var t=this;this._core.$element.find(this._core.options.validator.applyTo).each(function(){e(this).parent().append(e("<span/>",{"class":t._core.options.validator["class"]}))})},t.prototype.watch=function(){var t=this;this._core.$element.find(this._core.options.validator.applyTo).on("keyup",function(){e(this).is("input")&&e(this).parent().trigger("mfValidator.validate",{options:t._core.options.validator})}).on("change",function(){e(this).parent().trigger("mfValidator.validate",{options:t._core.options.validator})}).parent().on(this._handlers).find("."+this._core.options.validator["class"]).on("click",function(){e(this).removeClass("error").removeClass("show").addClass("hide").parent().trigger("mfValidator.click").find(t._core.options.validator.applyTo).focus()}),this._core.$element.on("submit",e.proxy(function(i){return this._core.$element.find(this._core.options.validator.applyTo).each(function(){e(this).parent().trigger("mfValidator.validate",{options:t._core.options.validator})}),this._core.$element.find(".error").length?(i.preventDefault(),!1):void 0},this)).on("reset",e.proxy(function(){this._core.$element.find(this._core.options.validator.applyTo).each(function(){e(this).parent().trigger("mfValidator.reset",{options:t._core.options.validator})})},this))},t.prototype.validate=function(t,i){var o=[],s=e(this),n=s.find(i.options.applyTo),r=n.data("constraints").match(/\@\w+/g),a=n.val();for(var c in r)if(i.options.constraints[r[c]])switch(typeof i.options.constraints[r[c]].rule){case"function":i.options.constraints[r[c]].rule(n)||o.push(i.options.constraints[r[c]].message);break;default:new RegExp(i.options.constraints[r[c]].rule).test(a)||o.push(i.options.constraints[r[c]].message)}o.length?e(this).trigger("mfValidator.error",{options:i.options,errors:o}):e(this).trigger("mfValidator.valid",{options:i.options})},t.prototype.error=function(t,i){e(this).find("."+i.options["class"]).removeClass("valid").removeClass("hide").addClass("show").addClass("error").text(i.errors)},t.prototype.valid=function(t,i){e(this).find("."+i.options["class"]).removeClass("error").removeClass("show").addClass("valid").addClass("hide").text(i.errors)},t.prototype.reset=function(t,i){e(this).find("."+i.options["class"]).removeClass("show").removeClass("hide").text("")}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Input=function(i){this._core=i,this._handlers={"mfInput.focus":this.focus,"mfInput.blur":this.blur,"mfInput.type":this.type,"mfInput.delete":this["delete"],"mfInput.fill":this.fill,"mfInput.empty":this.empty,"mfInput.idle":this.idle,"mfInput.reset":this.reset,click:function(e){return e.preventDefault(),!1}},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={input:{applyto:'input[type="text"], input[type="date"], textarea',"class":"mfInput"}},t.prototype.initialize=function(){this._core.$element.trigger("mfInput.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfInput.initialized")},t.prototype.create=function(){this._core.$element.find(this._core.options.input.applyto).parent().addClass(this._core.options.input["class"])},t.prototype.watch=function(){this._core.$element.find(this._core.options.input.applyto).on("focus",function(){e(this).parent().trigger("mfInput.focus")}).on("blur",function(){e(this).parent().trigger("mfInput.blur"),""===e(this).val()&&e(this).parent().trigger("mfInput.void")}).on("keydown",this,function(t){t.data.ignore(t)||((8===t.keyCode||46===t.keyCode)&&e(this).parent().trigger("mfInput.delete"),(32===t.keyCode||t.keyCode>46)&&e(this).parent().trigger("mfInput.type"))}).on("keyup",this,function(t){var i=e(this);t.data.ignore(t)||(""===i.val()&&i.parent().trigger("mfInput.empty"),8===t.keyCode||46===t.keyCode?(self.timer&&clearTimeout(self.timer),self.timer=setTimeout(function(){i.parent().trigger("mfInput.idle")},1e3)):(i.parent().trigger("mfInput.fill"),i.parent().trigger("mfInput.type"),self.timer&&clearTimeout(self.timer),self.timer=setTimeout(function(){i.parent().trigger("mfInput.idle")},1e3)))}).on("keypress",this,function(t){if(!t.data.ignore(t.keyCode)){var i=e(this);self.timer&&clearTimeout(self.timer),self.timer=setTimeout(function(){i.parent().trigger("mfInput.idle")},1e3)}}).parent().on(this._handlers),this._core.$element.on("mf.reset",this,function(t){e(this).find("."+t.data._core.options.input["class"]).each(function(){e(this).trigger("mfInput.reset")})})},t.prototype.focus=function(){e(this).addClass("focused")},t.prototype.blur=function(){e(this).removeClass("focused")},t.prototype.type=function(){e(this).removeClass("deleting"),e(this).addClass("typing")},t.prototype["delete"]=function(){e(this).removeClass("typing"),e(this).addClass("deleting")},t.prototype.fill=function(){e(this).addClass("filled")},t.prototype.empty=function(){e(this).removeClass("filled")},t.prototype.idle=function(){e(this).removeClass("typing"),e(this).removeClass("deleting")},t.prototype.reset=function(){e(this).removeClass("focused"),e(this).removeClass("deleting"),e(this).removeClass("filled"),e(this).removeClass("typing"),e(this).removeClass("error")},t.prototype.ignore=function(e){return 144===e.keyCode||20===e.keyCode||17===e.keyCode||37===e.keyCode||38===e.keyCode||39===e.keyCode||40===e.keyCode||112===e.keyCode||113===e.keyCode||114===e.keyCode||115===e.keyCode||116===e.keyCode||117===e.keyCode||118===e.keyCode||119===e.keyCode||120===e.keyCode||121===e.keyCode||122===e.keyCode||123===e.keyCode||9===e.keyCode||e.ctrlKey?!0:!1}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Select=function(i){this._core=i,this._handlers={"mfSelect.close":this.close,"mfSelect.open":this.open,"mfSelect.select":this.select,click:function(e){e.preventDefault(),e.stopPropagation()}},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={select:{applyTo:"select","class":"mfSelect"}},t.prototype.initialize=function(){this._core.$element.trigger("mfSelect.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfSelect.initialized")},t.prototype.create=function(){this._core.$element.find(this._core.options.select.applyTo).each(function(){var t=e(this);t.css({position:"absolute",left:"50%",width:"0",height:"0",overflow:"hidden",opacity:"0"}).parent().append(e("<div/>",{"class":"value",text:t.find("option:selected").text()})).append(e("<ul/>",{"class":"dropdown"})).end().find("option").each(function(t){if(0!=t){var i=e(this);i.parent().parent().find(".dropdown").append(e("<li/>",{"class":"option",text:i.text()}).addClass(i.is(":selected")?"selected":""))}})}).parent().addClass(this._core.options.select["class"])},t.prototype.watch=function(){var t=this;this._core.$element.find(t._core.options.select.applyTo).on("focus",this.focus).on("blur",function(){e(this).parent().trigger("mfSelect.close").removeClass("focus")}).on("keydown",function(t){38==t.keyCode&&e(this).val(e(this).find("option").eq(e(this).find("option:selected").index()>0?e(this).find("option:selected").index()-1:0).text()).trigger("change"),40==t.keyCode&&e(this).val(e(this).find("option").eq(e(this).find("option:selected").index()<e(this).find("option").length-1?e(this).find("option:selected").index()+1:e(this).find("option").length-1).text()).trigger("change"),13==t.keyCode&&e(this).parent().trigger(e(this).parent().hasClass("show")?"mfSelect.close":"mfSelect.open"),(32==t.keyCode||37==t.keyCode||38==t.keyCode||39==t.keyCode||40==t.keyCode||13==t.keyCode)&&t.preventDefault()}).on("change",function(){e(this).parent().trigger("mfSelect.open").find(".value").text(e(this).val());var t=e(this).find("option:selected").index(),i=e(this).parent().find(".option").removeClass("selected");t>0&&i.eq(t-1).addClass("selected")}).parent().on(this._handlers).find(".value").on("click",function(){var i=e(this),o=i.parent().find("select"),s=o.find("option").eq(0).text();if(i.text(s),o.trigger("focus").off("focus",t.focus),!e(this).parent().hasClass("show")){o.on("focus",t.focus);var n=e(this).parent().find(".option.selected");n.length&&i.text(n.text())}}).parent().find(".option").on("click",function(){e(this).parent().find(".option").removeClass("selected"),e(this).addClass("selected"),e(this).parent().parent().find("select").focus().on("focus",t.focus),e(this).parent().parent().trigger("mfSelect.select",{options:t._core.options.select,value:e(this).text()})}).parents("body").on("click",function(i){var o=t._core.$element.find("."+t._core.options.select["class"]);o.length&&(o.is(i.target)||0!==o.has(i.target).length||o.find("select").each(function(){var t=e(this).parent().find(".option.selected");t.length&&e(this).parent().find(".value").text(t.text())}).on("focus",t.focus))}),this._core.$element.on("mf.reset",function(){e(this).find(t._core.options.select.applyTo).each(function(){e(this).parent().find(".value").text(e(this).prop("selectedIndex",0).val()),e(this).parent().find(".option").removeClass("selected")})})},t.prototype.focus=function(){e(this).parent().trigger("mfSelect.open").addClass("focus")},t.prototype.close=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("show")&&e(this).removeClass("show")},t.prototype.open=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("show")||e(this).addClass("show")},t.prototype.select=function(t,i){e(this).find(i.options.applyTo).val(i.value).trigger("change"),e(this).trigger("mfSelect.close")}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.DatePicker=function(i){this._core=i,this._handlers={"mfDatePicker.close":this.close,"mfDatePicker.open":this.open,"mfDatePicker.next":this.next,"mfDatePicker.prev":this.prev,"mfDatePicker.update":this.update,"mfDatePicker.refresh":this.refresh,"mfDatePicker.pick":this.pick},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={datepicker:{applyTo:'input[type="date"]',"class":"mfDatePicker",days:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],format:"MM-DD-YYYY",prevMonth:"",nextMonth:""}},t.prototype.initialize=function(){this._core.$element.trigger("mfDatePicker.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfDatePicker.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.datepicker.applyTo).each(function(){e(this).attr({type:navigator.userAgent.match(/(iPod|iPhone|iPad)/)?"date":"text","data-type":"date"}).after(e("<div/>",{"class":t._core.options.datepicker["class"]}).data("date",new Date))}).parent().find("."+t._core.options.datepicker["class"]).each(function(){e.proxy(t.update,this,{},t._core.options.datepicker).call(),e.proxy(t.refresh,this,{},t._core.options.datepicker).call()})},t.prototype.watch=function(){var t=this;t._core.$element.find("."+t._core.options.datepicker["class"]).on("click","."+t._core.options.datepicker["class"]+"_next",function(){var i=e(this).parents("."+t._core.options.datepicker["class"]);i.trigger("mfDatePicker.next"),i.trigger("mfDatePicker.update",t._core.options.datepicker),i.trigger("mfDatePicker.refresh",t._core.options.datepicker)}).on("click","."+t._core.options.datepicker["class"]+"_prev",function(){var i=e(this).parents("."+t._core.options.datepicker["class"]);i.trigger("mfDatePicker.prev"),i.trigger("mfDatePicker.update",t._core.options.datepicker),i.trigger("mfDatePicker.refresh",t._core.options.datepicker)}).on("click",".dp-day",function(){var i=e(this).parents("."+t._core.options.datepicker["class"]);i.trigger("mfDatePicker.pick",{opt:t._core.options.datepicker,day:e(this)}),i.parent().find("input").on("blur",t.blur).trigger("blur").trigger("keyup")}).on("click",function(){}).on(this._handlers).parent().on("click",function(e){return e.preventDefault(),!1}).find("input").on("focus",function(){e(this).parent().find("."+t._core.options.datepicker["class"]).trigger("mfDatePicker.open")}).on("blur",this.blur).on("keydown",function(i){(9==i.keyCode||i.shiftKey&&9==i.keyCode)&&e(this).on("blur",t.blur)}).parents("body").on("mousedown",function(e){var i=t._core.$element.find("."+t._core.options.datepicker["class"]).parent();i.length&&(i.is(e.target)||0!==i.has(e.target).length?i.find("input").off("blur",t.blur):i.find("input").on("blur",t.blur).trigger("blur"))}),t._core.$element.on("mf.reset",function(){e(this).find("."+t._core.options.datepicker["class"]).each(function(){e(this).trigger("mfDatePicker.close")})})},t.prototype.blur=function(){e(this).parent().find(".mfDatePicker").trigger("mfDatePicker.close")},t.prototype.close=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("open")&&e(this).removeClass("open")},t.prototype.open=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("open")||e(this).addClass("open")},t.prototype.next=function(){var t=e(this),i=t.data("date");i=11==i.getMonth()?new Date(i.getFullYear()+1,0,1):new Date(i.getFullYear(),i.getMonth()+1,1),t.data("date",i)},t.prototype.prev=function(){var t=e(this),i=t.data("date");i=0==i.getMonth()?new Date(i.getFullYear()-1,11,1):new Date(i.getFullYear(),i.getMonth()-1,1),t.data("date",i)},t.prototype.pick=function(t,i){var o=e(this);o.data("pickedDate",i.day.addClass("dp-selected").data("date")),o.find(".dp-day").not(i.day).removeClass("dp-selected"),o.parent().find("input").val((o.data("pickedDate").getMonth()+1<10?"0"+(o.data("pickedDate").getMonth()+1):o.data("pickedDate").getMonth()+1)+"/"+(o.data("pickedDate").getDate()<10?"0"+o.data("pickedDate").getDate():o.data("pickedDate").getDate())+"/"+o.data("pickedDate").getFullYear())},t.prototype.update=function(t,i){var o=e(this),s=e("<div/>",{"class":i["class"]+"_panel"});s.append(e("<a/>",{"class":i["class"]+"_prev",text:i.prevMonth})),s.append(e("<a/>",{"class":i["class"]+"_next",text:i.nextMonth})),s.append(e("<div/>",{"class":i["class"]+"_title",text:i.months[o.data("date").getMonth()]+" "+o.data("date").getFullYear()}));var n=o.find("."+i["class"]+"_panel");n.length?n.replaceWith(s):s.appendTo(o)},t.prototype.refresh=function(t,i){for(var o=e(this),s=e("<table/>"),n=e("<tr/>"),r=0;r<i.days.length;r++)n.append(e("<th/>",{"class":"dp-weekday",text:i.days[r]}));s.append(n);for(var a=o.data("date"),c=o.data("pickedDate"),l=new Date(a.getFullYear(),a.getMonth()+1,0).getDate(),p=new Date(a.getFullYear(),a.getMonth(),0).getDate(),d=new Date(a.getFullYear(),a.getMonth(),1).getDay(),f=1,r=0;7>r;r++){n=e("<tr/>");for(var h=0;7>h;h++){var u,m=7*r+h+1,g=e("<td/>",{"class":"dp-day"}),y=new Date;if(y.setHours(0),y.setMinutes(0),y.setSeconds(0),y.setMilliseconds(0),0==h&&m>l+d)break;1>m-d?(g.text(p+(m-d)).addClass("dp-offset"),u=new Date(a.getFullYear(),a.getMonth()-1,p+(m-d))):l+d>=m?(g.text(m-d),u=new Date(a.getFullYear(),a.getMonth(),m-d)):(g.text(f).addClass("dp-offset"),u=new Date(a.getFullYear(),a.getMonth()+1,f++)),u.valueOf()==y.valueOf()&&g.addClass("dp-today"),c&&u.valueOf()==c.valueOf()&&g.addClass("dp-selected"),n.append(g.data("date",u))}""!=n.html()&&s.append(n)}var v=o.find("table");v.length?v.replaceWith(s):s.appendTo(o)}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Icon=function(i){this._core=i,this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};this._handlers={"mfIcon.change":this.change},t.Defaults={icon:{applyTo:"[data-add-icon]","class":"mfIcon",states:{".mfInput":{"mfIcon.default":["mfInput.blur","mfInput.idle","mfInput.reset"],"mfIcon.state-1":["mfInput.type"],"mfIcon.state-2":["mfInput.delete"]}}}},t.prototype.initialize=function(){this._core.$element.trigger("mfIcon.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfIcon.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.icon.applyTo).each(function(){var i=e(this);i.append(e("<span/>",{"class":t._core.options.icon["class"]}).append(e("<span/>")))})},t.prototype.watch=function(){var t=this;t._core.$element.find("."+t._core.options.icon["class"]).on(t._handlers);for(var i in t._core.options.icon.states){var o=t._core.$element.find(i);for(var s in t._core.options.icon.states[i])for(var n in t._core.options.icon.states[i][s])o.on(t._core.options.icon.states[i][s][n],{state:s},function(i){e(this).find("."+t._core.options.icon["class"]).attr("class",i.data.state.replace("."," "))})}}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Placeholder=function(i){this._core=i,this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};this._handlers={"mfIcon.change":this.change},t.Defaults={placeholder:{applyTo:"[data-add-placeholder]","class":"mfPlaceHolder",states:{".mfInput":{"mfPlaceHolder.default":["mfInput.void","mfInput.reset"],"mfPlaceHolder.state-1":["mfInput.fill","mfInput.focus"]}}}},t.prototype.initialize=function(){this._core.$element.trigger("mfPlaceHolder.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfPlaceHolder.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.placeholder.applyTo).each(function(){var i=e(this);i.append(e("<span/>",{"class":t._core.options.placeholder["class"],text:i.find("[placeholder]").attr("placeholder")?i.find("[placeholder]").attr("placeholder"):i.find("[data-placeholder]").attr("data-placeholder")})).find("[placeholder]").removeAttr("placeholder").removeAttr("data-placeholder")})},t.prototype.watch=function(){var t=this;t._core.$element.find("."+t._core.options.placeholder["class"]).on("click",function(){e(this).parent().find("input, textarea").trigger("focus")}).on(t._handlers);for(var i in t._core.options.icon.states){var o=t._core.$element.find(i);for(var s in t._core.options.placeholder.states[i])for(var n in t._core.options.placeholder.states[i][s])o.on(t._core.options.placeholder.states[i][s][n],{state:s},function(i){e(this).find("."+t._core.options.placeholder["class"]).attr("class",i.data.state.replace("."," "))})}}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Progress=function(i){this._core=i,this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={progress:{applyTo:"button[type='submit']","class":"mfProgress"}},t.prototype.initialize=function(){this._core.$element.trigger("mfProgress.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfProgress.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.progress.applyTo).each(function(){var i=e(this);i.addClass(t._core.options.progress["class"]).wrapInner(e("<span/>",{"class":"cnt"})).append(e("<span/>",{"class":"loader"})).append(e("<span/>",{"class":"msg"}))})},t.prototype.watch=function(){var t=this;t._core.$element.on("mf.process",function(){e(this).find("."+t._core.options.progress["class"]).addClass("sending")}).on("mf.fail",function(i,o){e(this).find("."+t._core.options.progress["class"]).removeClass("sending").addClass("fail").find(".msg").text(o.message),setTimeout(e.proxy(function(){e(this).find("."+t._core.options.progress["class"]).removeClass("fail").find(".msg").text("")},this),3e3)}).on("mf.success",function(i,o){e(this).find("."+t._core.options.progress["class"]).removeClass("sending").addClass("success").find(".msg").text(o.message),setTimeout(e.proxy(function(){e(this).find("."+t._core.options.progress["class"]).removeClass("success").find(".msg").text("")},this),1500)}).on("mf.reset",function(){e(this).find("."+t._core.options.progress["class"]).removeClass("sending").removeClass("fail").removeClass("success").find(".msg").text("")})}}(window.jQuery,window,document),function(e,t,i){e(i).ready(function(){var t=e(".mailform");t.length&&t.rdMailForm()})}(window.jQuery,window,document);


Merci à vous :)

Configuration: Windows / Chrome 71.0.3578.98


Vive l'informatique !

5 réponses

Résumé de la discussion

Problème rencontré: les messages envoyés via le formulaire rd-mailform ne contiennent ni le nom ni le numéro de téléphone du visiteur, alors que ces champs existent dans le formulaire et dans le code HTML. Des pistes techniques examinent comment le script PHP lit $_POST et remplit le template avec les infos, mais des soucis d’emplacement ou de version du fichier peuvent empêcher l’insertion des champs dans l’e-mail. Les échanges préconisent le débogage avec print_r($_POST), la validation du fichier rd-mailform.php et l’inspection de la console réseau (Ajax) pour repérer d’éventuelles transmissions manquantes. D'autres soulignent que le minifié sur une ligne rend le débogage difficile et recommandent de partager le code complet pour avancer.

Généré automatiquement par IA
sur la base des meilleures réponses
  1. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
     
    Bonjour,

    Ton formulaire a déjà fonctionné ( avec le nom/prénom) ?
    Si oui... qu'as tu modifié ?

    Sachant que :
    - Je ne vois aucune variable POST correspond directement à tes variable nom ou prénom.
    c'est donc très certainement cette portion du code qui le gère.
    foreach ($_POST as $key => $value) {
            if ($key != "email" && $key != "message" && $key != "form-type" && !empty($value)){
                $info = str_replace(
                    ["<!-- #{BeginInfo} -->", "<!-- #{InfoState} -->", "<!-- #{InfoDescription} -->"],
                    ["", ucfirst($key) . ':', $value],
                    $tmp[0][0]);
     
                $template = str_replace("<!-- #{EndInfo} -->", $info, $template);
            }
        }
    


    Il faudrait donc voir, côté Template, comment sont nommées les variables attendues.
    Et côté formulaire, quelles sont les variables envoyées puis reçues dans ton code PHP.

    - Pour le template, il faut que tu nous montres le contenu de ton fichier rd-mailform.tpl
    - Pour voir, dans ton script, quelles sont les variables reçues : faire un
    print_r($_POST); au début du script
    

    - - Nous donner le code de ton formulaire html

    NB: Merci de poster correctement ton code en utilisant les balises de code (et en y précisant le langage).
    J'ai édité ton message pour les corriger.

    NB² : Ta question étant d'avantage liée au PHP.. je la déplace dans le bon forum.

    0
    1. depaninf Messages postés 154 Statut Membre 13
       
      Bonjour Jordane, et merci pour ton aide.

      Oui cela a déjà fonctionné au début, je ne sais pas du tout ce que j'ai pu changer... à part mettre un captcha.

      Voici le code du rd-mailform.tpl (désolé je ne parviens pas à préciser le langage, j'ai tenté de sélectionner le code et de cliquer sur la flèche puis sur php mais ça ne donne rien):

      <!DOCTYPE [/html/htmlintro.php3 html] PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
        <head> 
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
          <meta name="viewport" content="initial-scale=1.0" />
          <meta name="format-detection" content="telephone=no" />
          <title><!-- #{Subject} --></title>
          <style type="text/css">  
          #outlook a {
            padding: 0;
          }
          body {
            width: 100% !important;
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%;
            margin: 0;
            padding: 0;
          }
          .ExternalClass {
            width: 100%;
          }
          .ExternalClass,
          .ExternalClass span,
          .ExternalClass font,
          .ExternalClass td,
          .ExternalClass [/contents/242-introduction-au-dynamic-html-dhtml div] {
            line-height: 100%;
          }
          .ExternalClass p {
            line-height: inherit;
          }
          #body-layout {
            margin: 0;
            padding: 0;
            width: 100% !important;
            line-height: 100% !important;
          }
          img {
            display: block;
            outline: none;
            text-decoration: none;
            -ms-interpolation-mode: bicubic;
          }
          a img {
            border: none;
          }
          table td {
            border-collapse: collapse;
          }
          table {
            border-collapse: collapse;
            mso-table-lspace: 0pt;
            mso-table-rspace: 0pt;
          }
          a {
            color: orange;
            outline: none;
          }
          </style>
        </head>
        <body id="body-layout" style="background: #406c8d;">
          <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td align="center" valign="top" style="padding: 0 15px;background: #406c8d;">
                <table align="center" cellpadding="0" cellspacing="0" border="0">
                  <tr>
                    <td height="15" style="height: 15px; line-height:15px;"></td>
                  </tr>
                  <tr>
                    <td width="600" align="center" valign="top" style="border-radius: 4px; overflow: hidden; box-shadow: 3px 3px 6px 0 rgba(0,0,0,0.2);background: #dde1e6;">
                      <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                          <td align="center" valign="top" style="border-top-left-radius: 4px; border-top-right-radius: 4px; overflow: hidden; padding: 0 20px;background: #302f35;">
                            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                              <tr>
                                <td height="30" style="height: 30px; line-height:30px;"></td>
                              </tr>
                              <tr>
                                <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 32px; mso-line-height-rule: exactly; line-height: 32px; font-weight: 400; letter-spacing: 1px;color: #ffffff;">Notification</td>
                              </tr>
                              <tr>
                                <td height="30" style="height: 30px; line-height:30px;"></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td align="center" valign="top" style="padding: 0 20px;">
                            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                              <tr>
                                <td height="30" style="height: 30px; line-height:30px;"></td>
                              </tr> 
                              <tr> 
                                <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 22px; font-weight: 400;color: #302f35;">Hi, someone left a message for you at <!-- #{SiteName} --></td> 
                              </tr>
                              <tr> 
                                <td height="20" style="height: 20px; line-height:20px;"></td>
                              </tr>
                              <tr>
                                <td align="center" valign="top">
                                  <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                      <td align="center" valign="top" style="background: #d1d5da;">
                                        <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                          <tr>
                                            <td height="1" style="height: 1px; line-height:1px;"></td>
                                          </tr>
                                        </table>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td align="center" valign="top" style="background: #e4e6e9;">
                                        <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                          <tr>
                                            <td height="2" style="height: 2px; line-height:2px;"></td>
                                          </tr>
                                        </table>
                                      </td>
                                    </tr>
                                  </table>
                                </td>
                              </tr>
                              <tr>
                                <td height="20" style="height: 20px; line-height:20px;"></td>
                              </tr>
                              <tr>
                                <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 24px; mso-line-height-rule: exactly; line-height: 30px; font-weight: 700;color: #302f35;">
                                 <!-- #{Subject} -->
                                </td>
                              </tr>
                              <tr>
                                <td height="20" style="height: 20px; line-height:20px;"></td>
                              </tr>
                              <tr>
                                <td align="center" valign="top">
                                  <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                      <td align="center" valign="top">
                                        <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                          <tr>
                                            <td width="40" align="left" valign="top" style="padding: 0 10px 0 0;font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 20px; font-weight: 400;color: #302f35;font-weight: 700;"><!-- #{FromState} --></td>
                                            <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 20px; font-weight: 400;color: #302f35;"><!-- #{FromEmail} --></td> 
                                          </tr> 
                                         <!-- #{BeginInfo} -->
                                          <tr> 
                                            <td width="40" align="left" valign="top" style="padding: 0 10px 0 0;font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 20px; font-weight: 400;color: #302f35;font-weight: 700;"><!-- #{InfoState} --></td>
                                            <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 20px; font-weight: 400;color: #302f35;"><!-- #{InfoDescription} --></td>
                                          </tr>
                                         <!-- #{EndInfo} -->                                    
                                        </table>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td height="12" style="height: 12px; line-height:12px;"></td>
                                    </tr>
                                    <tr>
                                      <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 20px; font-weight: 400;color: #302f35;font-weight: 700;"><!-- #{MessageState} --></td>
                                    </tr>
                                    <tr>
                                      <td align="left" valign="top" style="font-family: Arial, sans-serif; font-size: 14px; mso-line-height-rule: exactly; line-height: 20px; font-weight: 400;color: #302f35;">
                                      <!-- #{MessageDescription} -->   
                                      </td>
                                    </tr>
                                  </table>
                                </td>
                              </tr>
                              <tr>
                                <td height="40" style="height: 40px; line-height:40px;"></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td height="20" style="height: 20px; line-height:20px;"></td>
                  </tr>
                  <tr>
                    <td width="600" align="center" valign="top">
                      <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                          <td align="center" valign="top" style="font-family: Arial, sans-serif; font-size: 12px; mso-line-height-rule: exactly; line-height: 18px; font-weight: 400;color: #a1b4c4;">This is an automatically generated email, please do not reply.</td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td height="20" style="height: 20px; line-height:20px;"></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </body>
      </html>


      Voici le code HTML:
      <div class="col-md-8 col-sm-8 col-xs-12">
      <font size="6" color="#333333" face="Raleway sans-serif">Formulaire de contact</font><br>
                              <br><form class='mailform' method="post" action="bat/rd-mailform.php">
                                  <input type="hidden" name="form-type" value="contact"/>
                                  <fieldset>
                                      <div class="mail-wrap">
      
      
                                          <label data-add-placeholder>
                                              <input type="text"
                                                     name="name"
                                                     placeholder="Nom*:"
                                                     data-constraints="@LettersOnly @NotEmpty"/>
                                          </label>
                                          <label data-add-placeholder>
                                              <input type="text"
                                                     name="email"
                                                     placeholder="E-mail*:"
                                                     data-constraints="@Email @NotEmpty"/>
                                          </label>
                                          <label data-add-placeholder>
                                              <input type="text"
                                                     name="phone"
                                                     placeholder="Téléphone*:"
                                                     data-constraints="@Phone @NotEmpty"/>
                                          </label>
                                      </div>
      
                                      <label data-add-placeholder>
                                          <textarea name="message" placeholder="Commentaires*:"
                                                    data-constraints="@NotEmpty"></textarea>
                                      </label>
              <div class="g-recaptcha" data-sitekey="6LeErncUAAAAAAarIfgPzd4Xp0M9P0KevYNfT9Lo"></div>
              <div class="mfControls">
                                          <button class="btn-primary" title="Envoyez-nous votre message" type="submit">Soumettre</button>
                                      </div>
                                      <p>*requis</p><br/>
                                  </fieldset>
             </form>
                          </div>


      Les messages que je reçois aujourd'hui:


      Ceux que je recevais avant:


      Encore merci
      0
  2. depaninf Messages postés 154 Statut Membre 13
     
    Plus d'idée ? Snifff
    0
    1. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
       
      Ben j'attends le résultat du print_r ...
      0
    2. depaninf Messages postés 154 Statut Membre 13
       
      Ooops c'est bon je l'ai mis
      0
    3. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830 > depaninf Messages postés 154 Statut Membre
       
      Et donc... ça t'affiche quoi lorsque tu valides ton formulaire ?
      0
    4. depaninf Messages postés 154 Statut Membre 13
       
      Franchement j'en sais rien Jordane...je dois faire quoi pour connaître le résultat ?
      0
    5. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830 > depaninf Messages postés 154 Statut Membre
       
      Tu m'as répondu :

      Ooops c'est bon je l'ai mis

      Donc... il ne te reste plus qu'à remplir ton formulaire, à le valider.... et à voir ce que ça t'affiche à l'écran..
      Comme tu utilises le plugin jquery jquery-rd-mailform.min.js, la transmission du formulaire se fait en Ajax.
      Il faut donc regarder dans la console du navigateur.
      A cet effet, je te conseille d'utiliser Firefox.
      Si tu veux absolument le faire sous chrome... il te faudra avant installer le plugin ajax debuger
      0
  3. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
     
    Actuellement ton formulaire retourne MF000
    As tu bien ajouté le print_r comme indiqué et un die ?

    Sans le die.. normal que tu ne puisses pas voir le résultat
    
    <?php
     
    //pour debuguer les variables envoyées
    print_r($_POST,true);
    exit(); // ou sinon.. mettre en commentaire la ligne du code :  die('MF000'); 
    
    $recipients = 'monadressemail';
    //$recipients = '#';
     
    try {
        require './phpmailer/PHPMailerAutoload.php';
     
        preg_match_all("/([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)/", $recipients, $addresses, PREG_OFFSET_CAPTURE);
    










    Maintenant que tu as les billes pour debuguer de l'ajax... tu peux t'amuser à placer des echo / print de tes variables dans le code php pour voir ce qu'elles contiennent/retourne. (typiquement dans la boucle qui alimente le template )
    //  die('MF000');
    
    0
    1. depaninf Messages postés 154 Statut Membre 13
       
      Non j'ai juste mis
      print_r($_POST); 
      en tout début de formulaire...
      je dois mettre
      print_r($_POST);  //  die('MF000');
      ?

      Pardon mais je n'y connais rien à ces fichiers là
      0
    2. depaninf Messages postés 154 Statut Membre 13
       
      J'obtiens ça:
      JQMIGRATE: Logging is active
      AAuE7mDdT7OCRG-iVjjYLG7rgqtOKsIgnFkhj5_OhoXmOfQ:1 GET https://lh3.googleusercontent.com/a-/s48-c/AAuE7mDdT7OCRG-iVjjYLG7rgqtOKsIgnFkhj5_OhoXmOfQ 404
      Image (async)
      Gj @ init_embed.js:165
      Ej @ init_embed.js:158
      t.mc @ init_embed.js:157
      Y @ init_embed.js:153
      ij @ init_embed.js:147
      Sj @ init_embed.js:196
      vk @ init_embed.js:211
      yk @ init_embed.js:213
      vl @ init_embed.js:267
      ul.mapType_changed @ init_embed.js:269
      cc @ init_embed.js:31
      F.set @ init_embed.js:30
      hc @ init_embed.js:32
      En @ init_embed.js:405
      b @ init_embed.js:413
      jf @ init_embed.js:64
      ff @ init_embed.js:65
      b @ init_embed.js:62
      load (async)
      bf @ init_embed.js:61
      Ze @ init_embed.js:60
      (anonymous) @ init_embed.js:414
      (anonymous) @ embed?pb=!1m18!1m12!1m3!1d2629.8211336673157!2d2.4683823156711364!3d48.766211979278516!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0xd1c5a5ceed3072d7!2sSOS+Dépannage+Informatique!5e0!3m2!1sfr!2sus!4v1499367345408:14
      AAuE7mDdT7OCRG-iVjjYLG7rgqtOKsIgnFkhj5_OhoXmOfQ:1 Failed to load resource: the server responded with a status of 404 ()
      AAuE7mDdT7OCRG-iVjjYLG7rgqtOKsIgnFkhj5_OhoXmOfQ:1 Failed to load resource: the server responded with a status of 404 ()
      AAuE7mDdT7OCRG-iVjjYLG7rgqtOKsIgnFkhj5_OhoXmOfQ:1 Failed to load resource: the server responded with a status of 404 ()
      jquery.rd-mailform.min.js:1 MF000
      recaptcha__fr.js:305 Active resource loading counts reached a per-frame limit while the tab was in background. Network requests will be delayed until a previous loading finishes, or the tab is brought to the foreground. See https://www.chromestatus.com/feature/5527160148197376 for more details
      recaptcha__fr.js:305 Active resource loading counts reached a per-frame limit while the tab was in background. Network requests will be delayed until a previous loading finishes, or the tab is brought to the foreground. See https://www.chromestatus.com/feature/5527160148197376 for more details


      Je vois bien la console mais ni les paramètres ni la réponse...

      0
    3. depaninf Messages postés 154 Statut Membre 13
       
      C'est vrai je n'ai pas utilisé Firefox mais, que ça renvoie une réponse ou une autre je ne saurai pas l'interpréter et corriger le problème....
      0
    4. depaninf Messages postés 154 Statut Membre 13
       
      Sur Firefox j'obtiens ça:
      JQMIGRATE: Logging is active jquery-migrate-1.2.1.js:1:141
      Content Security Policy: La source « 'unsafe-inline' » présente dans script-src a été ignorée : « strict-dynamic » a été spécifié
      Content Security Policy: La source « https: » présente dans script-src a été ignorée : « strict-dynamic » a été spécifié
      Content Security Policy: La source « http: » présente dans script-src a été ignorée : « strict-dynamic » a été spécifié
      Content Security Policy: La source « 'unsafe-inline' » présente dans script-src a été ignorée : « strict-dynamic » a été spécifié
      Content Security Policy: La source « https: » présente dans script-src a été ignorée : « strict-dynamic » a été spécifié
      Content Security Policy: La source « http: » présente dans script-src a été ignorée : « strict-dynamic » a été spécifié
      Ce site semble utiliser un effet de positionnement lié au défilement. Cet effet pourrait ne pas fonctionner correctement avec le défilement asynchrone. Consultez https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects pour obtenir davantage de détails ou discuter des outils et des fonctionnalités liés. contact.html
      MF005


      Les paramètres donnent ça:


      Et je ne trouve toujours pas "réponse"
      0
    5. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
       
      Pour debuguer l'ajax
      Il faut, soit utiliser Firefox (c'est le plus simple pour ça )
      Soit installer, pour chrome, le plugin Ajax debuger
      Je te l'ai déjà dit !!!

      Après... que tu saches ou non interpréter

      Pour ce qui est de la ligne de code à utiliser...
      Relis bien TOUT ce que j'ai écrit !
      As tu mis en commentaire la ligne (qui se trouve vers la fin de ton fichier ) et qui contient : die('MF000');
      ????

      Si tu ne commentes pas cette ligne.. impossible de voir le résultat !
      0
  4. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
     
    Tu peux nous reposter le code php complet de ce fichier ?

    Et également, si nous dire où tu as téléchargé ton script js jquery-rd-mailform.min.js
    As tu le fichier non minifié ? jquery-rd-mailform.js ? Si oui, peux tu utiliser ce fichier là au lieu du .min ? (et nous coller le code du fichier ici )

    0
    1. depaninf Messages postés 154 Statut Membre 13
       
      Non je n'ai que jquery.form.min et jquery.rd-mailform.min...
      Je poste le jquery.rd-mailform.min:
      !function(e){function t(i,o){this.options=e.extend({},t.Defaults,o),this.$element=e(i),this._plugins={},this._handlers={"mf.success mf.fail":e.proxy(this.update,this),"mf.process":e.proxy(this.process,this),reset:e.proxy(this.reset,this)},e.each(t.Plugins,e.proxy(function(e,t){this._plugins[e[0].toLowerCase()+e.slice(1)]=new t(this)},this)),this.initialize()}var i;i={MF000:"Sent",MF001:"Recipients are not set!",MF002:"Form will not work locally!",MF003:"Please, define email field in your form!",MF004:"Please, define type of your form!",MF254:"Something went wrong with PHPMailer!",MF255:"Aw, snap! Something went wrong."},t.Defaults={baseClass:"rd-mailform"},t.Plugins={},t.prototype.initialize=function(){this.$element.trigger("mf.initialize"),this.$element.addClass(this.options.baseClass).trigger("reset"),this.create(),this.watch(),this.$element.trigger("mf.initialized")},t.prototype.create=function(){},t.prototype.watch=function(){var e=this;e.$element.ajaxForm({beforeSubmit:function(){e.$element.trigger("mf.process")},error:function(t){e.$element.trigger("mf.fail",{code:t,message:i[t]})},success:function(t){console.log(t),"MF000"==t?e.$element.trigger("mf.success",{code:t,message:i[t]}):(t=5==t.length?t:"MF255",e.$element.trigger("mf.fail",{code:t,message:i[t]}))}}).on(this._handlers)},t.prototype.process=function(){this.$element.addClass("process")},t.prototype.update=function(t,i){this.$element.removeClass("process"),this.$element.addClass("MF000"===i.code?"success":"fail"),setTimeout(e.proxy(function(){this.$element.trigger("reset")},this),3e3)},t.prototype.reset=function(){this.$element.removeClass("success"),this.$element.removeClass("fail"),this.$element.trigger("mf.reset")},e.fn.rdMailForm=function(i){return this.each(function(){e(this).data("rdMailForm")||e(this).data("rdMailForm",new t(this,i))})},e.fn.rdMailForm.Constructor=t}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Validator=function(i){this._core=i,this._handlers={"mfValidator.validate":this.validate,"mfValidator.error":this.error,"mfValidator.valid":this.valid,"mfValidator.reset":this.reset,"mfValidator.click":e.noop()},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={validator:{applyTo:"[data-constraints]","class":"mfValidation",constraints:{"@LettersOnly":{rule:"^([a-zA-Zа-яА-ЯіїёІЇЁєЄҐґ\\s]{0,})$",message:"Please use letters only!"},"@NumbersOnly":{rule:"^-?\\d*\\.?\\d*$",message:"Please use numbers only!"},"@NotEmpty":{rule:"([^\\s])",message:"Field should not be empty!"},"@Email":{rule:"^(([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)){0,}$",message:"Enter valid e-mail address!"},"@Phone":{rule:"^(\\+?\\d{0,3}\\s*\\(?\\d{1,3}\\)?\\s*\\d{3}\\s*\\d{4}){0,}$",message:"Enter valid phone number!"},"@Date":{rule:function(e){return navigator.userAgent.match(/(iPod|iPhone|iPad)/)?!0:new RegExp("^($)|(((0[13578]|10|12)(-|\\/)((0[1-9])|([12])([0-9])|(3[01]?))(-|\\/)((19)([2-9])(\\d{1})|(20)([01])(\\d{1})|([8901])(\\d{1}))|(0?[2469]|11)(-|/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|/)((19)([2-9])(\\d{1})|(20)([01])(\\d{1})|([8901])(\\d{1}))))$").test(e.val())},message:"Use MM/DD/YYYY format!"},"@SelectRequired":{rule:function(e){return 0!==e.find("option:selected").index()},message:"Please choose an option!"}}}},t.prototype.initialize=function(){this._core.$element.trigger("mfValidator.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfValidator.initialized")},t.prototype.create=function(){var t=this;this._core.$element.find(this._core.options.validator.applyTo).each(function(){e(this).parent().append(e("<span/>",{"class":t._core.options.validator["class"]}))})},t.prototype.watch=function(){var t=this;this._core.$element.find(this._core.options.validator.applyTo).on("keyup",function(){e(this).is("input")&&e(this).parent().trigger("mfValidator.validate",{options:t._core.options.validator})}).on("change",function(){e(this).parent().trigger("mfValidator.validate",{options:t._core.options.validator})}).parent().on(this._handlers).find("."+this._core.options.validator["class"]).on("click",function(){e(this).removeClass("error").removeClass("show").addClass("hide").parent().trigger("mfValidator.click").find(t._core.options.validator.applyTo).focus()}),this._core.$element.on("submit",e.proxy(function(i){return this._core.$element.find(this._core.options.validator.applyTo).each(function(){e(this).parent().trigger("mfValidator.validate",{options:t._core.options.validator})}),this._core.$element.find(".error").length?(i.preventDefault(),!1):void 0},this)).on("reset",e.proxy(function(){this._core.$element.find(this._core.options.validator.applyTo).each(function(){e(this).parent().trigger("mfValidator.reset",{options:t._core.options.validator})})},this))},t.prototype.validate=function(t,i){var o=[],s=e(this),n=s.find(i.options.applyTo),r=n.data("constraints").match(/\@\w+/g),a=n.val();for(var c in r)if(i.options.constraints[r[c]])switch(typeof i.options.constraints[r[c]].rule){case"function":i.options.constraints[r[c]].rule(n)||o.push(i.options.constraints[r[c]].message);break;default:new RegExp(i.options.constraints[r[c]].rule).test(a)||o.push(i.options.constraints[r[c]].message)}o.length?e(this).trigger("mfValidator.error",{options:i.options,errors:o}):e(this).trigger("mfValidator.valid",{options:i.options})},t.prototype.error=function(t,i){e(this).find("."+i.options["class"]).removeClass("valid").removeClass("hide").addClass("show").addClass("error").text(i.errors)},t.prototype.valid=function(t,i){e(this).find("."+i.options["class"]).removeClass("error").removeClass("show").addClass("valid").addClass("hide").text(i.errors)},t.prototype.reset=function(t,i){e(this).find("."+i.options["class"]).removeClass("show").removeClass("hide").text("")}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Input=function(i){this._core=i,this._handlers={"mfInput.focus":this.focus,"mfInput.blur":this.blur,"mfInput.type":this.type,"mfInput.delete":this["delete"],"mfInput.fill":this.fill,"mfInput.empty":this.empty,"mfInput.idle":this.idle,"mfInput.reset":this.reset,click:function(e){return e.preventDefault(),!1}},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={input:{applyto:'input[type="text"], input[type="date"], textarea',"class":"mfInput"}},t.prototype.initialize=function(){this._core.$element.trigger("mfInput.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfInput.initialized")},t.prototype.create=function(){this._core.$element.find(this._core.options.input.applyto).parent().addClass(this._core.options.input["class"])},t.prototype.watch=function(){this._core.$element.find(this._core.options.input.applyto).on("focus",function(){e(this).parent().trigger("mfInput.focus")}).on("blur",function(){e(this).parent().trigger("mfInput.blur"),""===e(this).val()&&e(this).parent().trigger("mfInput.void")}).on("keydown",this,function(t){t.data.ignore(t)||((8===t.keyCode||46===t.keyCode)&&e(this).parent().trigger("mfInput.delete"),(32===t.keyCode||t.keyCode>46)&&e(this).parent().trigger("mfInput.type"))}).on("keyup",this,function(t){var i=e(this);t.data.ignore(t)||(""===i.val()&&i.parent().trigger("mfInput.empty"),8===t.keyCode||46===t.keyCode?(self.timer&&clearTimeout(self.timer),self.timer=setTimeout(function(){i.parent().trigger("mfInput.idle")},1e3)):(i.parent().trigger("mfInput.fill"),i.parent().trigger("mfInput.type"),self.timer&&clearTimeout(self.timer),self.timer=setTimeout(function(){i.parent().trigger("mfInput.idle")},1e3)))}).on("keypress",this,function(t){if(!t.data.ignore(t.keyCode)){var i=e(this);self.timer&&clearTimeout(self.timer),self.timer=setTimeout(function(){i.parent().trigger("mfInput.idle")},1e3)}}).parent().on(this._handlers),this._core.$element.on("mf.reset",this,function(t){e(this).find("."+t.data._core.options.input["class"]).each(function(){e(this).trigger("mfInput.reset")})})},t.prototype.focus=function(){e(this).addClass("focused")},t.prototype.blur=function(){e(this).removeClass("focused")},t.prototype.type=function(){e(this).removeClass("deleting"),e(this).addClass("typing")},t.prototype["delete"]=function(){e(this).removeClass("typing"),e(this).addClass("deleting")},t.prototype.fill=function(){e(this).addClass("filled")},t.prototype.empty=function(){e(this).removeClass("filled")},t.prototype.idle=function(){e(this).removeClass("typing"),e(this).removeClass("deleting")},t.prototype.reset=function(){e(this).removeClass("focused"),e(this).removeClass("deleting"),e(this).removeClass("filled"),e(this).removeClass("typing"),e(this).removeClass("error")},t.prototype.ignore=function(e){return 144===e.keyCode||20===e.keyCode||17===e.keyCode||37===e.keyCode||38===e.keyCode||39===e.keyCode||40===e.keyCode||112===e.keyCode||113===e.keyCode||114===e.keyCode||115===e.keyCode||116===e.keyCode||117===e.keyCode||118===e.keyCode||119===e.keyCode||120===e.keyCode||121===e.keyCode||122===e.keyCode||123===e.keyCode||9===e.keyCode||e.ctrlKey?!0:!1}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Select=function(i){this._core=i,this._handlers={"mfSelect.close":this.close,"mfSelect.open":this.open,"mfSelect.select":this.select,click:function(e){e.preventDefault(),e.stopPropagation()}},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={select:{applyTo:"select","class":"mfSelect"}},t.prototype.initialize=function(){this._core.$element.trigger("mfSelect.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfSelect.initialized")},t.prototype.create=function(){this._core.$element.find(this._core.options.select.applyTo).each(function(){var t=e(this);t.css({position:"absolute",left:"50%",width:"0",height:"0",overflow:"hidden",opacity:"0"}).parent().append(e("<div/>",{"class":"value",text:t.find("option:selected").text()})).append(e("<ul/>",{"class":"dropdown"})).end().find("option").each(function(t){if(0!=t){var i=e(this);i.parent().parent().find(".dropdown").append(e("<li/>",{"class":"option",text:i.text()}).addClass(i.is(":selected")?"selected":""))}})}).parent().addClass(this._core.options.select["class"])},t.prototype.watch=function(){var t=this;this._core.$element.find(t._core.options.select.applyTo).on("focus",this.focus).on("blur",function(){e(this).parent().trigger("mfSelect.close").removeClass("focus")}).on("keydown",function(t){38==t.keyCode&&e(this).val(e(this).find("option").eq(e(this).find("option:selected").index()>0?e(this).find("option:selected").index()-1:0).text()).trigger("change"),40==t.keyCode&&e(this).val(e(this).find("option").eq(e(this).find("option:selected").index()<e(this).find("option").length-1?e(this).find("option:selected").index()+1:e(this).find("option").length-1).text()).trigger("change"),13==t.keyCode&&e(this).parent().trigger(e(this).parent().hasClass("show")?"mfSelect.close":"mfSelect.open"),(32==t.keyCode||37==t.keyCode||38==t.keyCode||39==t.keyCode||40==t.keyCode||13==t.keyCode)&&t.preventDefault()}).on("change",function(){e(this).parent().trigger("mfSelect.open").find(".value").text(e(this).val());var t=e(this).find("option:selected").index(),i=e(this).parent().find(".option").removeClass("selected");t>0&&i.eq(t-1).addClass("selected")}).parent().on(this._handlers).find(".value").on("click",function(){var i=e(this),o=i.parent().find("select"),s=o.find("option").eq(0).text();if(i.text(s),o.trigger("focus").off("focus",t.focus),!e(this).parent().hasClass("show")){o.on("focus",t.focus);var n=e(this).parent().find(".option.selected");n.length&&i.text(n.text())}}).parent().find(".option").on("click",function(){e(this).parent().find(".option").removeClass("selected"),e(this).addClass("selected"),e(this).parent().parent().find("select").focus().on("focus",t.focus),e(this).parent().parent().trigger("mfSelect.select",{options:t._core.options.select,value:e(this).text()})}).parents("body").on("click",function(i){var o=t._core.$element.find("."+t._core.options.select["class"]);o.length&&(o.is(i.target)||0!==o.has(i.target).length||o.find("select").each(function(){var t=e(this).parent().find(".option.selected");t.length&&e(this).parent().find(".value").text(t.text())}).on("focus",t.focus))}),this._core.$element.on("mf.reset",function(){e(this).find(t._core.options.select.applyTo).each(function(){e(this).parent().find(".value").text(e(this).prop("selectedIndex",0).val()),e(this).parent().find(".option").removeClass("selected")})})},t.prototype.focus=function(){e(this).parent().trigger("mfSelect.open").addClass("focus")},t.prototype.close=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("show")&&e(this).removeClass("show")},t.prototype.open=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("show")||e(this).addClass("show")},t.prototype.select=function(t,i){e(this).find(i.options.applyTo).val(i.value).trigger("change"),e(this).trigger("mfSelect.close")}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.DatePicker=function(i){this._core=i,this._handlers={"mfDatePicker.close":this.close,"mfDatePicker.open":this.open,"mfDatePicker.next":this.next,"mfDatePicker.prev":this.prev,"mfDatePicker.update":this.update,"mfDatePicker.refresh":this.refresh,"mfDatePicker.pick":this.pick},this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={datepicker:{applyTo:'input[type="date"]',"class":"mfDatePicker",days:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],format:"MM-DD-YYYY",prevMonth:"",nextMonth:""}},t.prototype.initialize=function(){this._core.$element.trigger("mfDatePicker.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfDatePicker.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.datepicker.applyTo).each(function(){e(this).attr({type:navigator.userAgent.match(/(iPod|iPhone|iPad)/)?"date":"text","data-type":"date"}).after(e("<div/>",{"class":t._core.options.datepicker["class"]}).data("date",new Date))}).parent().find("."+t._core.options.datepicker["class"]).each(function(){e.proxy(t.update,this,{},t._core.options.datepicker).call(),e.proxy(t.refresh,this,{},t._core.options.datepicker).call()})},t.prototype.watch=function(){var t=this;t._core.$element.find("."+t._core.options.datepicker["class"]).on("click","."+t._core.options.datepicker["class"]+"_next",function(){var i=e(this).parents("."+t._core.options.datepicker["class"]);i.trigger("mfDatePicker.next"),i.trigger("mfDatePicker.update",t._core.options.datepicker),i.trigger("mfDatePicker.refresh",t._core.options.datepicker)}).on("click","."+t._core.options.datepicker["class"]+"_prev",function(){var i=e(this).parents("."+t._core.options.datepicker["class"]);i.trigger("mfDatePicker.prev"),i.trigger("mfDatePicker.update",t._core.options.datepicker),i.trigger("mfDatePicker.refresh",t._core.options.datepicker)}).on("click",".dp-day",function(){var i=e(this).parents("."+t._core.options.datepicker["class"]);i.trigger("mfDatePicker.pick",{opt:t._core.options.datepicker,day:e(this)}),i.parent().find("input").on("blur",t.blur).trigger("blur").trigger("keyup")}).on("click",function(){}).on(this._handlers).parent().on("click",function(e){return e.preventDefault(),!1}).find("input").on("focus",function(){e(this).parent().find("."+t._core.options.datepicker["class"]).trigger("mfDatePicker.open")}).on("blur",this.blur).on("keydown",function(i){(9==i.keyCode||i.shiftKey&&9==i.keyCode)&&e(this).on("blur",t.blur)}).parents("body").on("mousedown",function(e){var i=t._core.$element.find("."+t._core.options.datepicker["class"]).parent();i.length&&(i.is(e.target)||0!==i.has(e.target).length?i.find("input").off("blur",t.blur):i.find("input").on("blur",t.blur).trigger("blur"))}),t._core.$element.on("mf.reset",function(){e(this).find("."+t._core.options.datepicker["class"]).each(function(){e(this).trigger("mfDatePicker.close")})})},t.prototype.blur=function(){e(this).parent().find(".mfDatePicker").trigger("mfDatePicker.close")},t.prototype.close=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("open")&&e(this).removeClass("open")},t.prototype.open=function(){navigator.userAgent.match(/(iPod|iPhone|iPad)/)||e(this).hasClass("open")||e(this).addClass("open")},t.prototype.next=function(){var t=e(this),i=t.data("date");i=11==i.getMonth()?new Date(i.getFullYear()+1,0,1):new Date(i.getFullYear(),i.getMonth()+1,1),t.data("date",i)},t.prototype.prev=function(){var t=e(this),i=t.data("date");i=0==i.getMonth()?new Date(i.getFullYear()-1,11,1):new Date(i.getFullYear(),i.getMonth()-1,1),t.data("date",i)},t.prototype.pick=function(t,i){var o=e(this);o.data("pickedDate",i.day.addClass("dp-selected").data("date")),o.find(".dp-day").not(i.day).removeClass("dp-selected"),o.parent().find("input").val((o.data("pickedDate").getMonth()+1<10?"0"+(o.data("pickedDate").getMonth()+1):o.data("pickedDate").getMonth()+1)+"/"+(o.data("pickedDate").getDate()<10?"0"+o.data("pickedDate").getDate():o.data("pickedDate").getDate())+"/"+o.data("pickedDate").getFullYear())},t.prototype.update=function(t,i){var o=e(this),s=e("<div/>",{"class":i["class"]+"_panel"});s.append(e("<a/>",{"class":i["class"]+"_prev",text:i.prevMonth})),s.append(e("<a/>",{"class":i["class"]+"_next",text:i.nextMonth})),s.append(e("<div/>",{"class":i["class"]+"_title",text:i.months[o.data("date").getMonth()]+" "+o.data("date").getFullYear()}));var n=o.find("."+i["class"]+"_panel");n.length?n.replaceWith(s):s.appendTo(o)},t.prototype.refresh=function(t,i){for(var o=e(this),s=e("<table/>"),n=e("<tr/>"),r=0;r<i.days.length;r++)n.append(e("<th/>",{"class":"dp-weekday",text:i.days[r]}));s.append(n);for(var a=o.data("date"),c=o.data("pickedDate"),l=new Date(a.getFullYear(),a.getMonth()+1,0).getDate(),p=new Date(a.getFullYear(),a.getMonth(),0).getDate(),d=new Date(a.getFullYear(),a.getMonth(),1).getDay(),f=1,r=0;7>r;r++){n=e("<tr/>");for(var h=0;7>h;h++){var u,m=7*r+h+1,g=e("<td/>",{"class":"dp-day"}),y=new Date;if(y.setHours(0),y.setMinutes(0),y.setSeconds(0),y.setMilliseconds(0),0==h&&m>l+d)break;1>m-d?(g.text(p+(m-d)).addClass("dp-offset"),u=new Date(a.getFullYear(),a.getMonth()-1,p+(m-d))):l+d>=m?(g.text(m-d),u=new Date(a.getFullYear(),a.getMonth(),m-d)):(g.text(f).addClass("dp-offset"),u=new Date(a.getFullYear(),a.getMonth()+1,f++)),u.valueOf()==y.valueOf()&&g.addClass("dp-today"),c&&u.valueOf()==c.valueOf()&&g.addClass("dp-selected"),n.append(g.data("date",u))}""!=n.html()&&s.append(n)}var v=o.find("table");v.length?v.replaceWith(s):s.appendTo(o)}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Icon=function(i){this._core=i,this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};this._handlers={"mfIcon.change":this.change},t.Defaults={icon:{applyTo:"[data-add-icon]","class":"mfIcon",states:{".mfInput":{"mfIcon.default":["mfInput.blur","mfInput.idle","mfInput.reset"],"mfIcon.state-1":["mfInput.type"],"mfIcon.state-2":["mfInput.delete"]}}}},t.prototype.initialize=function(){this._core.$element.trigger("mfIcon.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfIcon.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.icon.applyTo).each(function(){var i=e(this);i.append(e("<span/>",{"class":t._core.options.icon["class"]}).append(e("<span/>")))})},t.prototype.watch=function(){var t=this;t._core.$element.find("."+t._core.options.icon["class"]).on(t._handlers);for(var i in t._core.options.icon.states){var o=t._core.$element.find(i);for(var s in t._core.options.icon.states[i])for(var n in t._core.options.icon.states[i][s])o.on(t._core.options.icon.states[i][s][n],{state:s},function(i){e(this).find("."+t._core.options.icon["class"]).attr("class",i.data.state.replace("."," "))})}}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Placeholder=function(i){this._core=i,this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};this._handlers={"mfIcon.change":this.change},t.Defaults={placeholder:{applyTo:"[data-add-placeholder]","class":"mfPlaceHolder",states:{".mfInput":{"mfPlaceHolder.default":["mfInput.void","mfInput.reset"],"mfPlaceHolder.state-1":["mfInput.fill","mfInput.focus"]}}}},t.prototype.initialize=function(){this._core.$element.trigger("mfPlaceHolder.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfPlaceHolder.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.placeholder.applyTo).each(function(){var i=e(this);i.append(e("<span/>",{"class":t._core.options.placeholder["class"],text:i.find("[placeholder]").attr("placeholder")?i.find("[placeholder]").attr("placeholder"):i.find("[data-placeholder]").attr("data-placeholder")})).find("[placeholder]").removeAttr("placeholder").removeAttr("data-placeholder")})},t.prototype.watch=function(){var t=this;t._core.$element.find("."+t._core.options.placeholder["class"]).on("click",function(){e(this).parent().find("input, textarea").trigger("focus")}).on(t._handlers);for(var i in t._core.options.icon.states){var o=t._core.$element.find(i);for(var s in t._core.options.placeholder.states[i])for(var n in t._core.options.placeholder.states[i][s])o.on(t._core.options.placeholder.states[i][s][n],{state:s},function(i){e(this).find("."+t._core.options.placeholder["class"]).attr("class",i.data.state.replace("."," "))})}}}(window.jQuery,window,document),function(e){var t=e.fn.rdMailForm.Constructor.Plugins.Progress=function(i){this._core=i,this._core.options=e.extend({},t.Defaults,this._core.options),this.initialize()};t.Defaults={progress:{applyTo:"button[type='submit']","class":"mfProgress"}},t.prototype.initialize=function(){this._core.$element.trigger("mfProgress.initialize"),this.create(),this.watch(),this._core.$element.trigger("mfProgress.initialized")},t.prototype.create=function(){var t=this;t._core.$element.find(t._core.options.progress.applyTo).each(function(){var i=e(this);i.addClass(t._core.options.progress["class"]).wrapInner(e("<span/>",{"class":"cnt"})).append(e("<span/>",{"class":"loader"})).append(e("<span/>",{"class":"msg"}))})},t.prototype.watch=function(){var t=this;t._core.$element.on("mf.process",function(){e(this).find("."+t._core.options.progress["class"]).addClass("sending")}).on("mf.fail",function(i,o){e(this).find("."+t._core.options.progress["class"]).removeClass("sending").addClass("fail").find(".msg").text(o.message),setTimeout(e.proxy(function(){e(this).find("."+t._core.options.progress["class"]).removeClass("fail").find(".msg").text("")},this),3e3)}).on("mf.success",function(i,o){e(this).find("."+t._core.options.progress["class"]).removeClass("sending").addClass("success").find(".msg").text(o.message),setTimeout(e.proxy(function(){e(this).find("."+t._core.options.progress["class"]).removeClass("success").find(".msg").text("")},this),1500)}).on("mf.reset",function(){e(this).find("."+t._core.options.progress["class"]).removeClass("sending").removeClass("fail").removeClass("success").find(".msg").text("")})}}(window.jQuery,window,document),function(e,t,i){e(i).ready(function(){var t=e(".mailform");t.length&&t.rdMailForm()})}(window.jQuery,window,document);
      0
      1. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830 > depaninf Messages postés 154 Statut Membre
         
        Le fichier min est sur une seule ligne.... ce qui le rend très compliqué à lire et/ou à modifier
        Je t'ai demandé où tu l'avais trouvé.... car il y a certainement, à l'endroit où tu l'as choppé .. la version full ..
        0
    2. depaninf Messages postés 154 Statut Membre 13
       
      J'ai acheté le Template chez Template Monster...
      Il est dans le dossier \js\mailform
      0
    3. depaninf Messages postés 154 Statut Membre 13
       
      Jordane ? Plus de nouvelles...
      0
  5. Vous n’avez pas trouvé la réponse que vous recherchez ?

    Posez votre question
  6. depaninf Messages postés 154 Statut Membre 13
     
    Toutes ces opérations pour rien...quelle perte de temps !
    0