• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: <solved>looking to affect output of Formbuilder error page
PostPosted: Mon Feb 06, 2012 7:55 pm 
Offline
Forum Members
Forum Members

Joined: Fri Aug 05, 2011 9:02 pm
Posts: 94
Hi, for my Formbuilder form, when you hit submit without entering all the required information, not only do you get an arrow pointing next to the required field, but at the beginning of the document you get large text saying what that field already says.

So, is there a way to get rid of that large text at the top, and just keep the errors that have the arrow next to them, next to the actual field that needs attention?

Also can I change the size/color of the text that says "<-- Please enter a value for " ?


Last edited by RyanC on Tue Feb 07, 2012 8:36 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: looking to affect output of Formbuilder error page
PostPosted: Mon Feb 06, 2012 9:43 pm 
Offline
Power Poster
Power Poster

Joined: Fri Jun 06, 2008 5:54 pm
Posts: 345
All of these can be done by adding/editing the associated CSS or by editing the form template. The developer left all the options in so that the user (you in this case) can customize the form to your specific needs. Some people like all the error message grouped and some like then in content (like you do).

In the FomBuilder section of the CMS Admin, you can edit the form template and remove or comment out the area on the top of the template that displays all the error messages grouped together.

Alternatively, you can add the following to the CSS and that will hide that section:
Code:
div.error_message div.error {display:none;}


Hope that helps.
-S


Top
 Profile  
 
 Post subject: Re: looking to affect output of Formbuilder error page
PostPosted: Mon Feb 06, 2012 10:55 pm 
Offline
Forum Members
Forum Members

Joined: Fri Aug 05, 2011 9:02 pm
Posts: 94
Thanks for the response.

Which part of this would get commented out? I guess my problem is I don't know anything about php. I only know HTML. So I don't know what I'm looking at here. I recognize the html tags but I don't know what the other stuff on the page is.

Code:
$fb_form_header}
{if $fb_form_done == 1}
   {* This first section is for displaying submission errors *}
   {if $fb_submission_error}
      <div class="error_message">{$fb_submission_error}</div>
      {if $fb_show_submission_errors}
         <table class="error">
         {foreach from=$fb_submission_error_list item=thisErr}
            <tr><td>{$thisErr}</td></tr>
         {/foreach}
         </table>
      {/if}
   {/if}
{else}
   {* this section is for displaying the form *}
   {* we start with validation errors *}
   {if $fb_form_has_validation_errors}
      <div class="error_message">
      <ul>
      {foreach from=$fb_form_validation_errors item=thisErr}
         <li>{$thisErr}</li>
      {/foreach}
      </ul>
      </div>


I added your css tag to my styles and it didn't have an effect, and I also tried putting it inline into the template document itself... I just copied and pasted directly :

Code:
div.error_message div.error {display:none;}


Top
 Profile  
 
 Post subject: Re: looking to affect output of Formbuilder error page
PostPosted: Tue Feb 07, 2012 6:26 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Mar 23, 2006 9:25 am
Posts: 1425
Location: The Netherlands
words between {* *} are comment, as fas as I know, it's called Smarty logic.

Gregor


Top
 Profile  
 
 Post subject: Re: looking to affect output of Formbuilder error page
PostPosted: Tue Feb 07, 2012 3:30 pm 
Offline
Power Poster
Power Poster

Joined: Fri Jun 06, 2008 5:54 pm
Posts: 345
@RyanC - Here is what you can comment out (from the code excerpt you posted) - I've commented out the code towards the bottom.

Code:
$fb_form_header}
{if $fb_form_done == 1}
   {* This first section is for displaying submission errors *}
   {if $fb_submission_error}
      <div class="error_message">{$fb_submission_error}</div>
      {if $fb_show_submission_errors}
         <table class="error">
         {foreach from=$fb_submission_error_list item=thisErr}
            <tr><td>{$thisErr}</td></tr>
         {/foreach}
         </table>
      {/if}
   {/if}
{else}
   {* this section is for displaying the form *}
   {* we start with validation errors *}
   {if $fb_form_has_validation_errors}
      {*<div class="error_message">
      <ul>
      {foreach from=$fb_form_validation_errors item=thisErr}
         <li>{$thisErr}</li>
      {/foreach}
      </ul>
      </div>*}


Top
 Profile  
 
 Post subject: Re: looking to affect output of Formbuilder error page
PostPosted: Tue Feb 07, 2012 8:36 pm 
Offline
Forum Members
Forum Members

Joined: Fri Aug 05, 2011 9:02 pm
Posts: 94
Great! Thanks spcherub. :)


Top
 Profile  
 
 Post subject: Re: <solved>looking to affect output of Formbuilder error pa
PostPosted: Sat Feb 18, 2012 12:43 am 
Offline
Forum Members
Forum Members

Joined: Fri Feb 17, 2012 4:25 pm
Posts: 89
Dear spcherub... I am trying to do exactly the opposite of what Ryan did - I like the error messages at the top but not in the content as it mucks up my form layout. Please could you show me exactly where to comment out the other error messages? Sorry I have tried countless ways and can't seem to figure it out! ???

I think it's the same as Ryan's, here it is {* DEFAULT FORM LAYOUT / pure CSS *}
{$fb_form_header}
{if $fb_form_done == 1}
{* This first section is for displaying submission errors *}
{if isset($fb_submission_error) && $fb_submission_error}
<div class="error_message">{$fb_submission_error}</div>
{if isset($fb_show_submission_errors) && $fb_show_submission_errors}
<div class="error"><ul>
{foreach from=$fb_submission_error_list item=thisErr}
<li>{$thisErr}</li>
{/foreach}
</ul>
</div>
{/if}
{/if}
{else}
{* this section is for displaying the form *}
{* we start with validation errors *}
{if isset($fb_form_has_validation_errors) && $fb_form_has_validation_errors}
<div class="error_message">
<ul>
{foreach from=$fb_form_validation_errors item=thisErr}
<li>{$thisErr}</li>
{/foreach}
</ul>
</div>


Top
 Profile  
 
 Post subject: Re: <solved>looking to affect output of Formbuilder error pa
PostPosted: Sat Feb 18, 2012 8:04 pm 
Offline
Power Poster
Power Poster

Joined: Fri Jun 06, 2008 5:54 pm
Posts: 345
@ladyr0gue - Please post your entire form template here and I can show you what you can comment out or delete. Also in your case I think it may be easier to suppress the error messages with the CSS, but we acn figure that out when you post the template.

-Sanjay


Top
 Profile  
 
 Post subject: Re: <solved>looking to affect output of Formbuilder error pa
PostPosted: Sat Feb 18, 2012 8:08 pm 
Offline
Power Poster
Power Poster

Joined: Fri Jun 06, 2008 5:54 pm
Posts: 345
@ladyr0gue -

Assuming you are using one of the default templates, here what you can do - the code you need to comment out is towards the bottom - search for the text ladyr0gue in the following code and you will see where the code has been commented out.

Code:
{* DEFAULT FORM LAYOUT / pure CSS *}
{$fb_form_header}
{if $fb_form_done == 1}
   {* This first section is for displaying submission errors *}
   {if isset($fb_submission_error) && $fb_submission_error}
      <div class="error_message">{$fb_submission_error}</div>
      {if isset($fb_show_submission_errors) && $fb_show_submission_errors}
         <div class="error">
         <ul>
         {foreach from=$fb_submission_error_list item=thisErr}
            <li>{$thisErr}</li>
         {/foreach}
         </ul>
      </div>
      {/if}
   {/if}
{else}
   {* this section is for displaying the form *}
   {* we start with validation errors *}
   {if isset($fb_form_has_validation_errors) && $fb_form_has_validation_errors}
      <div class="error_message">
      <ul>
      {foreach from=$fb_form_validation_errors item=thisErr}
         <li>{$thisErr}</li>
      {/foreach}
      </ul>
      </div>
   {/if}
   {if isset($captcha_error) && $captcha_error}
      <div class="error_message">{$captcha_error}</div>
   {/if}

   {* and now the form itself *}
   {$fb_form_start}
   <div>{$fb_hidden}</div>
   <div{if $css_class != ''} class="{$css_class}"{/if}>
   {if $total_pages gt 1}<span>{$title_page_x_of_y}</span>{/if}
   {foreach from=$fields item=entry}
      {if $entry->display == 1}
           {strip}
            {if $entry->needs_div == 1}
               <div
               {if $entry->required == 1 || $entry->css_class != '' || $entry->valid == 0} class="
                    {if $entry->required == 1}required{/if}
                    {if $entry->css_class != ''} {$entry->css_class}{/if}
                    {if $entry->valid == 0} fb_invalid{/if}
                    "
               {/if}
               >
            {/if}
            {if $entry->hide_name == 0}
               <label{if $entry->multiple_parts != 1} for="{$entry->input_id}"{/if}>{$entry->name}
               {if $entry->required_symbol != ''}
                     {$entry->required_symbol}
               {/if}
               </label>
            {/if}
            {if $entry->multiple_parts == 1}
               {section name=numloop loop=$entry->input}
                     {if $entry->label_parts == 1}
                        <div>{$entry->input[numloop]->input} {$entry->input[numloop]->name}</div>
                     {else}
                        {$entry->input[numloop]->input}
                     {/if}
                     {if isset($entry->input[numloop]->op) && $entry->input[numloop]->op}{$entry->input[numloop]->op}{/if}
               {/section}
            {else}
               {if $entry->smarty_eval == '1'}{eval var=$entry->input}{else}{$entry->input}{/if}
            {/if}
            {* commented out for ladyr0gue if $entry->valid == 0} <--- {$entry->error}{/if *}
            {if $entry->needs_div == 1}
               </div>
            {/if}
            {/strip}
        {/if}
   {/foreach}
   {if $has_captcha == 1}
      <div class="captcha">{$graphic_captcha}{$title_captcha}<br />{$input_captcha}</div>
   {/if}
   <div class="submit">{$prev}{$submit}</div>
   </div>
   {$fb_form_end}
{/if}
{$fb_form_footer}


Hope this helps
-Sanjay


Top
 Profile  
 
 Post subject: Re: <solved>looking to affect output of Formbuilder error pa
PostPosted: Mon Feb 20, 2012 2:32 pm 
Offline
Forum Members
Forum Members

Joined: Fri Feb 17, 2012 4:25 pm
Posts: 89
Thank you! Legend, that's exactly what I needed :) php is not my friend ^-^


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting