WordPress.org

Ready to get started?Download WordPress

Forums

MailChimp List Subscribe Form
[resolved] Placeholders - different text in different fields (3 posts)

  1. Jens D
    Member
    Posted 1 year ago #

    Hi

    I am struggling with placeholders on my site (marleneasmund.dk). I have used the "hack" to get a placeholder text (your email...), but it displays both in the "email" field and the "name" field. I'm not very strong with coding, so can anybody tell me how to get "Your Email..." in the email field and "Your Name..." in the name field?

    Best regards
    Jens Davidsen

    http://wordpress.org/extend/plugins/mailchimp/

  2. Jens D
    Member
    Posted 1 year ago #

    He he... I solved it with some help from another thread (the post by HWI).

    I used this code in mailchimp.widget.php :

    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="Dit navn..."/>';
    	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="Din email…"/>';
    				break;
    
    		}
    		if (!empty($var['helptext'])) {
    			$html .= '<span class="mc_help">'.esc_html($var['helptext']).'</span>';
    		}

    and it worked! "Din email..." is "your email" and "Dit navn..." is "your name" (in danish)

  3. mc_nate
    Member
    Posted 1 year ago #

    That's awesome, Jens!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic