Changeset 26070
- Timestamp:
- Dec 21, 2013, 6:38:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/template/contact_form.tpl
r25872 r26070 3 3 4 4 {footer_script require='livevalidation'} 5 {if $contact.mandatory_name and !$contact.is_logged} 6 var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true }); 7 author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a name'|translate}" }); 8 {/if} 5 (function(){ 6 {if $contact.mandatory_name and !$contact.is_logged} 7 var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true }); 8 author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a name'|translate}" }); 9 {/if} 9 10 10 {if $contact.mandatory_mail and (!$contact.is_logged or empty($contact.email))}11 var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true });12 email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter an e-mail'|translate}" });13 email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|translate}" });14 {/if}11 {if $contact.mandatory_mail and (!$contact.is_logged or empty($contact.email))} 12 var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true }); 13 email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter an e-mail'|translate}" }); 14 email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|translate}" }); 15 {/if} 15 16 16 {if $GROUPS}17 var group = new LiveValidation('group', {ldelim} onlyOnSubmit: true })18 group.add(Validate.Exclusion, {ldelim} within: ['-1'], failureMessage: "{'Please choose a category'|translate}" });19 {/if}17 {if $GROUPS} 18 var group = new LiveValidation('group', {ldelim} onlyOnSubmit: true }) 19 group.add(Validate.Exclusion, {ldelim} within: ['-1'], failureMessage: "{'Please choose a category'|translate}" }); 20 {/if} 20 21 21 var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true });22 subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|translate}" });23 subject.add(Validate.Length, {ldelim} maximum: 100,24 tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':100}"25 });22 var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true }); 23 subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|translate}" }); 24 subject.add(Validate.Length, {ldelim} maximum: 100, 25 tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':100}" 26 }); 26 27 27 var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true }); 28 content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|translate}" }); 29 content.add(Validate.Length, {ldelim} maximum: 2000, 30 tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':2000}", 31 }); 28 var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true }); 29 content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|translate}" }); 30 content.add(Validate.Length, {ldelim} maximum: 2000, 31 tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':2000}", 32 }); 33 }()); 32 34 {/footer_script} 33 35 … … 62 64 </td> 63 65 </tr> 64 66 {if $GROUPS} 65 67 <tr> 66 68 <td class="title"><label for="group">{'Category'|translate}</label></td> … … 72 74 </td> 73 75 </tr> 74 76 {/if} 75 77 <tr> 76 78 <td class="title"><label for="subject">{'Subject'|translate}</label></td> … … 81 83 <td><textarea name="content" id="cf_content" rows="10" style="width:400px;">{$contact.content}</textarea></td> 82 84 </tr> 85 {if isset($CRYPTO)} 86 {$CRYPTO.parsed_content} 87 {/if} 88 {if isset($EASYCAPTCHA)} 89 {$EASYCAPTCHA.parsed_content} 90 {/if} 83 91 <tr> 84 92 <td class="title"> </td>
Note: See TracChangeset
for help on using the changeset viewer.