Your e-mail here bar

27 views
Skip to first unread message

Chelsea Frangie

unread,
Apr 1, 2015, 5:14:05 AM4/1/15
to web...@googlegroups.com
Hi! 
How can I create a bar where users can type their e-mail address to apply for beta testing on a website? 

Thanks in advance! 

Message has been deleted

Dirk Mahlmeister

unread,
Apr 7, 2015, 8:31:22 AM4/7/15
to web...@googlegroups.com
Hi Chelsea!

It basically works like explained here:
https://groups.google.com/forum/#!topic/webpgr/zmrAR-58SWc

but in the HTML text editor you have to post

<form id="mailform">
<input class="input" name="name" data-name="Name" placeholder="Name" required="required" type="text">
<input class="input" name="email" data-name="Email" placeholder="Email" required="required" type="text">
<input name="subject" value="signup message from your homepage" type="hidden">
<input name="body" placeholder="optional message" type="hidden" value="nothing to see here"><br>
<input class="btn" value="I want to sign up" data-wait="Please wait..." type="submit"></form>

and in the JS tab you have to post:

mail_was_send = false
$
('#view').on('submit', '#mailform', function(e) {
  e
.preventDefault();
 
if(mail_was_send){
    $
.jGrowl('Your already successfully send a mail!');
   
return;
 
}
  $
.ajax({
    url
: localconfig.baseurl + "/email/send/" + app.this_page.id,
    data
: $(this).serialize(),
    type
: 'POST',
    success
: function(e) {
      mail_was_send
= true;
      $
.jGrowl('Sending your request worked!');
      $
('#mailform input').prop('disabled', true);
   
},
    error
: function(jqXHR, textStatus, errorThrown) {
     
if (app.this_user && app.this_user.id && ((app.this_user.id == app.this_page.get('ownr')) ||
         
(app.this_user.get('groups').indexOf('root') != -1) ||
         
(app.this_user.get('groups').indexOf(app.this_page.id) != -1))) {
        $
.jGrowl('Failed sending mail :\'(', {
          theme
: 'jGrowlError'
       
});
     
} else {
        $
.jGrowl('Failed sending mail: ' + jqXHR.responseText, {
          theme
: 'jGrowlError'
       
});
     
}
   
}
 
});
});

dont forget to press the save button next to the JS button after inserting this script.

The rest works like explained in the other thread.
And you should get a box saying "name", one box saying "email" and a button saying "I want to sign up"

Dirk Mahlmeister

unread,
Apr 9, 2015, 8:05:21 AM4/9/15
to web...@googlegroups.com
And of course you can style that form with css.

For example
#mailform input, #mailform textarea {
width
: 300px;
    box
-sizing: border-box;
margin
-top: 5px;
}


Reply all
Reply to author
Forward
0 new messages