WordPress.org

Ready to get started?Download WordPress

Forums

Simple Newsletter Signup
[resolved] Email confirmation (enter it twice) (2 posts)

  1. goldendude
    Member
    Posted 1 year ago #

    I didn't see it as a feature so I made the following modification to allow the form to ask the user to imput their email twice and reject if they don't match:

    [code block around lines 402-419 in simple-newsletter-signup/simple-newsletter-signup.php, replace with:]

    $list = '<div id="snsf-wrapper"><form method="post" name="simple-newsletter-signup-form" id="snsf-form" onsubmit="return checkemail(this);"><table><thead><tr><th colspan="2">'.$form_title.'</th></tr></thead><tbody><tfoot><tr><td colspan="2"><input type="submit" value="'.$button_title.'"';
    		if($terms_url != false){
    		$list .= ' disabled ';
    		}
    		$list.=' id="snsf-submit-button" /></td></tr></tfoot>';
    
    		if(isset($atts['name'])){
    		 	$list .= '<tr><td align="right"><label for="snsf-subscriber-name">Name:</label></td><td><input type="text" name="snsf-subscriber-name" /></td></tr>';
    		}
    
    		   // Email input
    
    		   $list .= '<tr><td align="right"><label for="snsf-subscriber-email">Email:</label></td><td><input type="text" name="snsf-subscriber-email" /></td></tr>';
    		   $list .= '<tr><td align="right"><label for="snsf-subscriber-email-confirm">Confirm:</label></td><td><input type="text" name="snsf-subscriber-email-confirm" /></td></tr>';
    		   if(isset($terms_url) and $terms_url != false){
    $list .= '<tr><td class="checkid"><input type="checkbox" name="snsf-subscriber-terms" id="snsf-checkbox" /></td><td class="termstd"><label for="snsf-subscriber-terms"><small><a href="'.$terms_url.'" target="_blank">'.$terms_text.'</a></small></label></td></tr>';
    		   }
    		   $list .= '</table><script language="JavaScript1.2">function checkemail(theForm){if ((theForm[\'snsf-subscriber-email\'].value != theForm[\'snsf-subscriber-email-confirm\'].value)){alert(\'Both e-mail address entries must match.\');return false;} else {return true;}}</script></form></div>';

    http://wordpress.org/extend/plugins/simple-newsletter-signup/

  2. Grant Kimball
    Member
    Plugin Author

    Posted 1 year ago #

    Very nice goldendude. I will test this out and implement it with your approval.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.