1 | {combine_css path="plugins/ContactForm/include/contactform.css"} |
---|
2 | {combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} |
---|
3 | |
---|
4 | {footer_script}{literal} |
---|
5 | function cf_validate() { |
---|
6 | var items = new Array('cf_from_name','cf_from_mail','cf_subject','cf_message'); |
---|
7 | var is_mail = new Array(false,true,false,false); |
---|
8 | var is_needed = new Array( |
---|
9 | {/literal}{if $CF.NEED_NAME}true{else}false{/if}{literal}, |
---|
10 | {/literal}{if $CF.NEED_MAIL}true{else}false{/if}{literal}, |
---|
11 | true,true); |
---|
12 | var messages = new Array( |
---|
13 | '{/literal}{'cf_from_name_error'|@translate|@escape:javascript}{literal}', |
---|
14 | '{/literal}{'cf_mail_format_error'|@translate|@escape:javascript}{literal}', |
---|
15 | '{/literal}{'cf_subject_error'|@translate|@escape:javascript}{literal}', |
---|
16 | '{/literal}{'cf_message_error'|@translate|@escape:javascript}{literal}'); |
---|
17 | var i; |
---|
18 | for (i=0 ; i<items.length ; i++) { |
---|
19 | var item = document.getElementById(items[i]); |
---|
20 | var is_ok = cf_check_content(item, is_mail[i]); |
---|
21 | if (!is_ok && is_needed[i]) { |
---|
22 | alert(messages[i]); |
---|
23 | item.focus(); |
---|
24 | return false; |
---|
25 | } |
---|
26 | } |
---|
27 | return true; |
---|
28 | } |
---|
29 | {/literal}{/footer_script} |
---|
30 | <div id="persoformtop">{$PERSOFORMTOP}</div> |
---|
31 | <div id="autre_content" class="contact-form"> |
---|
32 | <form method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> |
---|
33 | <div class="contact-form-content"> |
---|
34 | <table> |
---|
35 | <tr> |
---|
36 | <td class="contact-form-left">{'cf_from_name'|@translate}</td> |
---|
37 | <td class="contact-form-right"> |
---|
38 | {if $CF.LOGGED} |
---|
39 | <input type="text" name="cf_from_name_label" id="cf_from_name" size="40" value="{$CF.NAME}" disabled="disabled" class="cf-input-disabled"> |
---|
40 | <input type="hidden" name="cf_from_name" value="{$CF.NAME}" /> |
---|
41 | {else} |
---|
42 | <input type="text" name="cf_from_name" id="cf_from_name" size="40" value="{$CF.NAME}" class="cf-input"> |
---|
43 | {/if} |
---|
44 | </td> |
---|
45 | </tr> |
---|
46 | <tr> |
---|
47 | <td class="contact-form-left">{'cf_from_mail'|@translate}</td> |
---|
48 | <td class="contact-form-right"> |
---|
49 | {if $CF.LOGGED and ''!=$CF.EMAIL} |
---|
50 | <input type="text" name="cf_from_mail_label" id="cf_from_mail" size="40" value="{$CF.EMAIL}" disabled="disabled" class="cf-input-disabled"> |
---|
51 | <input type="hidden" name="cf_from_mail" value="{$CF.EMAIL}" /> |
---|
52 | {else} |
---|
53 | <input type="text" name="cf_from_mail" id="cf_from_mail" size="40" value="{$CF.EMAIL}" class="cf-input"></td> |
---|
54 | {/if} |
---|
55 | </td> |
---|
56 | </tr> |
---|
57 | <tr> |
---|
58 | <td class="contact-form-left">{'cf_subject'|@translate}</td> |
---|
59 | <td class="contact-form-right"><input type="text" name="cf_subject" id="cf_subject" size="40" value="{$CF.SUBJECT}" class="cf-input"></td> |
---|
60 | </tr> |
---|
61 | <tr> |
---|
62 | <td class="contact-form-left" id="cf_message_label">{'cf_message'|@translate}</td> |
---|
63 | <td class="contact-form-right"><textarea name="cf_message" id="cf_message" rows="10" cols="40">{$CF.MESSAGE}</textarea></td> |
---|
64 | </tr> |
---|
65 | <tr> |
---|
66 | <td class="contact-form-left"> </td> |
---|
67 | <td class="contact-form-right"><input class="submit" type="submit" value="{'cf_submit'|@translate}"></td> |
---|
68 | </tr> |
---|
69 | </table> |
---|
70 | <input type="hidden" name="cf_key" value="{$CF.KEY}" /> |
---|
71 | <input type="hidden" name="cf_id" value="{$CF.ID}" /> |
---|
72 | </div> |
---|
73 | </form> |
---|
74 | </div> |
---|
75 | <div id="persoformbottom">{$PERSOFORMBOTTOM}</div> |
---|