Hello
quelqu'un serait m'indiquer comment mettre une ligne de code pour pouvoir indiquer le titile en JS du genre :
merci compatriote
quelqu'un serait m'indiquer comment mettre une ligne de code pour pouvoir indiquer le titile en JS du genre :
.attr({title:'Contactez-nous par formulaire'})
voici le code de la page mais je ne sais pas ou placer cette ligne !!
[code]/*
* contactable 1.2.1 - jQuery Ajax contact form
*
* Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Revision: $Id: jquery.contactable.js 2010-01-18 $
*
*/
//extend the plugin
(function($){
//define the new for the plugin ans how to call it
$.fn.contactable = function(options) {
//set default options
var defaults = {
nom: 'Nom',
prenom: 'Prenom',
email: 'E-mail',
objet: 'Objet',
message : 'Message',
subject : 'Contact formulaire',
recievedMsg : 'Merci pour votre message',
notRecievedMsg : 'Sorry but your message could not be sent, try again later',
disclaimer: '* Chanmps obligatoires',
hideOnSubmit: true
};
//call in the default otions
var options = $.extend(defaults, options);
//act upon the element that is passed into the design
return this.each(function(options) {
//construct the form
$(this).html('<div id="contactable"></div><form id="contactForm" method="" action=""><div id="loading"></div><div id="callback"></div><div class="holder"><p><label for="nom">Nom <span class="red"> * </span></label><br /><input id="nom" class="contact" name="nom" /></p><p><label for="prenom">Prenom <span class="red"> * </span></label><br /><input id="prenom" class="contact" name="prenom" /></p><p><label for="email">E-mail <span class="red"> * </span></label><br /><input id="email" class="contact" name="email" /></p><p><label for="objet">Objet <span class="red"> * </span></label><br /><input id="objet" class="contact" name="objet" /></p><p><label for="message">Votre message<span class="red"> * </span></label><br /><textarea id="message" name="message" class="comment" rows="4" cols="30" ></textarea></p><p><input class="submit" type="submit" value="Envoyer votre message"/></p><p class="disclaimer">'+defaults.disclaimer+'</p></div></form>');
//show / hide function
$('div#contactable').toggle(function() {
$('#overlay').css({display: 'block'});
$(this).animate({"marginLeft": "-=5px"}, "fast");
$('#contactForm').animate({"marginLeft": "-=0px"}, "fast");
$(this).animate({"marginLeft": "+=387px"}, "slow");
$('#contactForm').animate({"marginLeft": "+=390px"}, "slow");
},
function() {
$('#contactForm').animate({"marginLeft": "-=390px"}, "slow");
$(this).animate({"marginLeft": "-=387px"}, "slow").animate({"marginLeft": "+=5px"}, "fast");
$('#overlay').css({display: 'none'});
});
//validate the form
$("#contactForm").validate({
//set the rules for the fild names
rules: {
nom: {
required: true,
minlength: 2
},
prenom: {
required: true,
minlength: 2
},
email: {
required: true,
email: true
},
objet: {
required: true,
minlength: 2
},
message: {
required: true
}
},
//set messages to appear inline
messages: {
nom: "",
prenom: "",
email: "",
objet: "",
message: ""
},
submitHandler: function() {
$('.holder').hide();
$('#loading').show();
$.post('mail.php',{subject:defaults.subject, nom:$('#nom').val(), prenom:$('#prenom').val(), email:$('#email').val(), objet:$('#objet').val(), message:$('#message').val()},
function(data){
$('#loading').css({display:'none'});
if( data == 'success') {
$('#callback').show().append(defaults.recievedMsg);
if(defaults.hideOnSubmit == true) {
//hide the tab after successful submition if requested
$('#contactForm').animate({dummy:1}, 2000).animate({"marginLeft": "-=450px"}, "slow");
$('div#contactable').animate({dummy:1}, 2000).animate({"marginLeft": "-=447px"}, "slow").animate({"marginLeft": "+=5px"}, "fast");
$('#overlay').css({display: 'none'});
}
} else {
$('#callback').show().append(defaults.notRecievedMsg);
}
});
}
});
});
};
})(jQuery);
merci compatriote
