Advertisement
stom66

Bootstrap4 Formbuilder Contact

Feb 17th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 4.80 KB | None | 0 0
  1. {* Customised Bootstrap Layout *}
  2. {$fb_form_header}
  3. {if $fb_form_done == 1}
  4.     {* This first section is for displaying submission errors *}
  5.     {if isset($fb_submission_error) && $fb_submission_error}
  6.         {assign var=disableNMS value="true" scope="global"}
  7.  
  8.         <div class="alert alert-danger fade in">
  9.             {$fb_submission_error}
  10.         </div>
  11.         {if isset($fb_show_submission_errors) && $fb_show_submission_errors}
  12.             <ul>
  13.                 {foreach from=$fb_submission_error_list item=thisErr}
  14.                     <li>{$thisErr}</li>
  15.                 {/foreach}
  16.             </ul>
  17.         {/if}
  18.     {/if}
  19. {else}
  20.     {* this section is for displaying the form *}
  21.     {* we start with validation errors *}
  22.     {if isset($fb_form_has_validation_errors) && $fb_form_has_validation_errors}
  23.  
  24.         <div class="alert alert-danger fade in">
  25.             <h4>
  26.                 <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  27.                 Sorry, we couldn't send your message. There was a problem with your...
  28.             </h4>
  29.             <ul style="margin-left:50px;">
  30.                 {foreach from=$fb_form_validation_errors item=thisErr}
  31.                     <li>{$thisErr|replace:'Please enter a value for ':''|replace:'"':''}</li>
  32.                 {/foreach}
  33.             </ul>
  34.         </div>
  35.     {/if}
  36.     {if isset($captcha_error) && $captcha_error}
  37.         <div class="alert alert-danger fade in">
  38.             <h4>
  39.                 <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  40.                 Sorry, we couldn't send your message. There was a problem with your...
  41.             </h4>
  42.             <ul style="margin-left:50px;">
  43.                 <li>{$captcha_error}</li>
  44.             </ul>
  45.            
  46.         </div>
  47.     {/if}
  48.  
  49.     {$fb_form_start|replace:'class="':'class="form-horizontal '}
  50.         <div>{$fb_hidden}</div>
  51.         {foreach from=$fields item=entry}
  52.             {if $entry->display == 1}
  53.                 <div class="form-group">
  54.                     {strip}                    
  55.                         {if $entry->hide_name == 0}
  56.                             <div class="col-xs-4 text-right">
  57.                                 <label class="control-label"
  58.                                     {if $entry->multiple_parts != 1} for="{$entry->input_id}"{/if}>
  59.                                     {$entry->name}
  60.                                     {if $entry->required_symbol != ''}
  61.                                         {$entry->required_symbol}
  62.                                     {/if}
  63.  
  64.                                     {if $entry->valid == 0}
  65.                                          <i class="fa fa-exclamation-triangle text-danger" aria-hidden="true"></i>
  66.                                     {/if}
  67.                                 </label>
  68.                             </div>
  69.                         {/if}
  70.  
  71.                         <div class="{if $entry->hide_name != 0}col-xs-12{else}col-xs-8{/if}" >
  72.                             {if $entry->multiple_parts == 1}
  73.                                 {section name=numloop loop=$entry->input}
  74.                                     {if $entry->label_parts == 1}
  75.                                         <!-- multi part input -->
  76.                                         <div>{$entry->input[numloop]->input}&nbsp;{$entry->input[numloop]->name}</div>
  77.                                     {else}
  78.                                         <div class="col-xs-4 no-padding">
  79.                                             {$entry->input[numloop]->input|replace:'class="':'class="form-control '}
  80.                                         </div>
  81.                                     {/if}
  82.                                     {if isset($entry->input[numloop]->op) && $entry->input[numloop]->op}{$entry->input[numloop]->op}{/if}
  83.                                 {/section}
  84.                             {else}
  85.                                 {if $entry->type=="Check Box"}<div class="checkbox">{/if}
  86.                                 {if $entry->smarty_eval == '1'}
  87.                                     {eval var=$entry->input|replace:'name="':'class="form-control" name="'|replace:'cms_dropdown':'form-control'}
  88.                                 {else}
  89.                                     {$entry->input|replace:'name="':'class="form-control" name="'|replace:'cms_dropdown':'form-control'}
  90.                                 {/if}
  91.                                 {if $entry->type=="Check Box"}</div>{/if}
  92.                             {/if}
  93.  
  94.                             {if $entry->helptext != ''}
  95.                                 &nbsp;<a href="javascript:fbht('{$entry->field_helptext_id}')"><img src="modules/FormBuilder/images/info-small.gif" alt="Help" /></a>
  96.                                 <span id="{$entry->field_helptext_id}" style="display:none" class="fbr_helptext">{$entry->helptext}</span>
  97.                             {/if}
  98.                         </div>
  99.                     {/strip}
  100.                 </div>
  101.             {/if}
  102.         {/foreach}
  103.  
  104.         {if isset($has_captcha) && $has_captcha == 1}
  105.             <div class="col-xs-12 col-sm-8 pull-right start-hidden">
  106.                 <div class="form-group" >
  107.                     <div class="captcha center-block">
  108.                         {$graphic_captcha}{$title_captcha}
  109.                         {$input_captcha}
  110.                     </div>
  111.                 </div>
  112.             </div>
  113.         {/if}
  114.  
  115.         <div class="col-xs-12">
  116.             <div class="btn-group btn-group-justified" role="group" aria-label="Submit Form">
  117.                 <div class="btn-group" role="group">
  118.                     <button type="reset" class="btn btn-lg btn-default hvr-sweep-to-left hover-spin-icon">
  119.                         {fa icon='fa-refresh'}
  120.                         &nbsp; Reset
  121.                     </button>
  122.                 </div>
  123.                 <div class="btn-group" role="group">
  124.                     <button type="submit" class="btn btn-lg btn-primary hvr-sweep-to-right hover-nudge-icon">
  125.                         Send &nbsp;
  126.                         {fa icon='fa-chevron-circle-right'}
  127.                     </button>
  128.                 </div>
  129.             </div>
  130.         </div>
  131.  
  132.     {$fb_form_end}
  133. {/if}
  134.  
  135. {literal}
  136.     <script type="text/javascript">
  137.         function fbht(htid) {
  138.             var fbhtc=document.getElementById(htid);
  139.             if (fbhtc) {
  140.                 if (fbhtc.style.display == 'none') {
  141.                     fbhtc.style.display = 'inline';
  142.                 } else {
  143.                     fbhtc.style.display = 'none';
  144.                 }
  145.             }
  146.         }
  147.     </script>
  148. {/literal}
  149.  
  150.  
  151. {$fb_form_footer}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement