{combine_css path=$CONTACT_FORM_PATH|@cat:"template/style.css"} {combine_script id="livevalidation" load="footer" path=$CONTACT_FORM_PATH|@cat:"template/livevalidation.min.js"} {footer_script require='livevalidation'} {if $contact.mandatory_name and !$contact.is_logged} var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true }); author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a name'|@translate}" }); {/if} {if $contact.mandatory_mail and (!$contact.is_logged or empty($contact.email))} var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true }); email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter an e-mail'|@translate}" }); email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|@translate}" }); {/if} {if $GROUPS} var group = new LiveValidation('group', {ldelim} onlyOnSubmit: true }) group.add(Validate.Exclusion, {ldelim} within: ['-1'], failureMessage: "{'Please choose a category'|@translate}" }); {/if} var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true }); subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|@translate}" }); subject.add(Validate.Length, {ldelim} minimum: 4, maximum: 100, tooShortMessage: "{'%s must not be less than %d characters long'|@translate|@sprintf:'':4}", tooLongMessage: "{'%s must not be more than %d characters long'|@translate|@sprintf:'':100}" }); var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true }); content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|@translate}" }); content.add(Validate.Length, {ldelim} minimum: 20, maximum: 2000, tooShortMessage: "{'%s must not be less than %d characters long'|@translate|@sprintf:'':20}", tooLongMessage: "{'%s must not be more %d characters long'|@translate|@sprintf:'':2000}", }); {/footer_script} {* *} {if $themeconf.name == "stripped" or $themeconf.parent == "stripped"} {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/stripped.tpl'} {assign var="clear" value="true"} {elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"} {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/simple.tpl'} {assign var="clear" value="true"} {else} {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/default.tpl'} {/if} {if isset($errors) or not empty($infos)} {include file='infos_errors.tpl'} {/if} {if $ContactForm_before}