Support » Plugin: MailChimp List Subscribe Form » [Plugin: MailChimp List Subscribe Form] Request: Add Placeholder text for Mailchimp Widget

Viewing 5 replies - 16 through 20 (of 20 total)
  • To show a placeholder for email I moved and dublicated some of the code
    Like this:

    break;
    
    			case 'url':
    			case 'imageurl':
    			case 'text':
    			case 'number':
    			default:
    				$html .= '
    	<input type="text" size="18" value="'.esc_html($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input" placeholder="'.esc_html($var['default']).'"/>';
    	break;
    			case 'email':
    	$html .= '
    	<input type="text" size="18" value="'.esc_html($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input" placeholder="E-mail"/>';
    				break;
    
    		}
    		if (!empty($var['helptext'])) {
    			$html .= '<span class="mc_help">'.esc_html($var['helptext']).'</span>';
    		}

    Moved case ’email’: and added another placeholder term

    So, I’m trying to add place holder text for Mailchimp widget following the instructions above, but I must be missing something. Is the above placeholder=”Your best email….” written exactly as it should be (minus “your best email…”)?

    This is what I have:

    <input type=”text” size=”4″ maxlength=”4″ value=”” name=”‘.esc_attr($opt.'[detail2]’).'” id=”‘.esc_attr($opt.’-detail2′).'” class=”mc_input mc_phone” />
    ‘;
    break;
    case ’email’:
    case ‘url’:
    case ‘imageurl’:
    case ‘text’:
    case ‘number’:
    default:
    $html .= ‘
    <input type=”text” size=”18″ value=”‘.esc_html($var[‘default’]).'” name=”‘.esc_attr($opt).'” id=”‘.esc_attr($opt).'” class=”mc_input”/>’ placeholder=”Your best email….”;
    break;

    Thanks for your help!

    Never mind! Dumb mistake on my part. Your instructions were perfect!

    I have also tried to get a placeholder in both fields, but I’m struggeling…

    I have used the

    At the end, just after class=”mc_input” add this:

    placeholder=”Your best email….”

    trick but that displayed “Din email… (Your email…) in both name and email field. I then used the

    default merge values

    trick by mc nate, but I can only do it in the name field, and the text is a different color (solid black) and you have to manually remove all the text before typing your name.

    Is there a way to use the first approach, but have different text in the two fields?

    Right now my mailchimp_widgte.php looks like this:

    break;
    			case 'email':
    			case 'url':
    			case 'imageurl':
    			case 'text':
    			case 'number':
    			default:
    				$html .= '
    	<input type="text" size="18" value="'.esc_html($var['default']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="mc_input" placeholder="Din email...." />';
    				break;

    And another question: How do I remove ” *=required field” ?

    Best
    Jens

    http://www.marleneasmund.dk

    I know this is an older thread, but there is a better way of adding the placeholder. If you have multiple fields you want on your form, the placeholder="Your best email..." adds that text inside all boxes.

    Instead, use placeholder="'.esc_html($var['name']).'" and your MailChimp Field Label will be displayed.

    Cheers!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘[Plugin: MailChimp List Subscribe Form] Request: Add Placeholder text for Mailchimp Widget’ is closed to new replies.