[Solved] Placeholder on E-mail from with copy FormBuilder

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

[Solved] Placeholder on E-mail from with copy FormBuilder

Post by Masweb »

I made a Form on with formbuilder without labels.
The placeholder are the labels.

I want to send a copy from this form to the subscriber but the field doesn’t have a default value field.

If I use the new from Email field I can't use the "sent copy to sender" possibility

Does anyone have a solution
Last edited by Masweb on Sat Nov 02, 2013 2:00 pm, edited 2 times in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Placeholder on E-mail from with copy FormBuilder

Post by velden »

If I understand it you say the 'Default value for field' is missing.

Quick and dirty (but effective) way would be a Smarty replace:

something like

Code: Select all

{$email->input|replace:'type="email"':'type="email" placeholder="E-mailadres..."'}
In this example I assume you're using created a custom form template where all fields are called 'manually'. If not use a replace on the whole {FormBuilder ...} tag. You might then look for a better 'search' string.

I think a little JS could do the job too.
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Re: Placeholder on E-mail from with copy FormBuilder

Post by Masweb »

velden wrote:If I understand it you say the 'Default value for field' is missing.

Quick and dirty (but effective) way would be a Smarty replace:

something like

Code: Select all

{$email->input|replace:'type="email"':'type="email" placeholder="E-mailadres..."'}
In this example I assume you're using created a custom form template where all fields are called 'manually'. If not use a replace on the whole {FormBuilder ...} tag. You might then look for a better 'search' string.

I think a little JS could do the job too.
Put this on different places but doesn't work.
I've changed $email in the code from the e-mail field in my case $fld_102
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Placeholder on E-mail from with copy FormBuilder

Post by velden »

Could you post relevant part of the template here?

And of course you have to look for a proper search string in your html code first.
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Re: Placeholder on E-mail from with copy FormBuilder

Post by Masweb »

Just use the default template:

Code: Select all

{* 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}&nbsp;{$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}
         	{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}
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Placeholder on E-mail from with copy FormBuilder

Post by velden »

Using the default template does not give you the option I initially suggested. So then it would become the second option:

Code: Select all

{FormBuilder whateveryouhavetherenow|replace:'searchstring':'searchstring placeholder="E-mailadres..."'}

Where searchstring must be an unique part of something inside the mentioned email input tag. You should look at the page source after enabling the Email address and Send copy to to find a proper, unique searchstring.
Masweb
Forum Members
Forum Members
Posts: 173
Joined: Sat May 09, 2009 4:26 pm

Re: Placeholder on E-mail from with copy FormBuilder

Post by Masweb »

This is it! Thanks.
velden wrote:Using the default template does not give you the option I initially suggested. So then it would become the second option:

Code: Select all

{FormBuilder whateveryouhavetherenow|replace:'searchstring':'searchstring placeholder="E-mailadres..."'}

Where searchstring must be an unique part of something inside the mentioned email input tag. You should look at the page source after enabling the Email address and Send copy to to find a proper, unique searchstring.
Post Reply

Return to “Modules/Add-Ons”