Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3271160
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:42:10+00:00 2026-05-17T18:42:10+00:00

Somehow, a simple form I have to sign up for a mailing list (which

  • 0

Somehow, a simple form I have to sign up for a mailing list (which adds an email to a Google Apps Group, using gdatav2rubyclientlib) seems to fail occasionally. The form is submitted via POST through jQuery, and the Sinatra app (running on nginx/Passenger) handles the POST and emails me a confirmation. Occasionally, I get emails that “undefined” signed up. Somehow, the value the user types in is getting lost, but I’m not sure how or why. . .

Here’s the HAML form from which the POST originates:

%li.sidebar-section
  %span#mailing-list-slug
    get on our mailing list
    <br/>
  %form{:id => "mailing_list_signup", :method => "post", :action => "/mailinglist/signup/the.grapevine"}
    %input{:type => 'text', :name => 'email', :value => "enter your email&hellip;", :id => 'mailing-list-signup'}
    %input{:id => "mailing_list_signup_button", :type => 'submit', :value => 'sign up'}
    #thanks
      thanks!  you're in!

Here’s the Javascript that makes the POST:
$(‘#mailing_list_signup_button’).click(function () {
var email_address = $(‘input#mailing-list-signup’).val();

  $.ajax({  
    type: "POST",  
    url: "/mailinglist/signup/the.grapevine",
    data: "email=" + email_address,
    success: function() {
      $('#thanks').show('slow');
    }
  });

  var email_address = $('input#email').val();

  $.post("/mailinglist/signup/the.grapevine", 
    $('form#mailing_list_signup').serialize(), function(result){alert(email_address);});
    return false; });
  });

Here’s my route handler for the POST request

post '/mailinglist/signup/:list' do
  adminuser = "ADMINUSERNAME"
  password  = "PASSWORD"
  email = params[:email]
  mailing_list = params[:list]
  myapps = ProvisioningApi.new(adminuser,password)
  myapps.add_member_to_group(email, mailing_list)
  gmail(:to => 'MYEMAIL', :subject => "HEY HEY GUESS WHAT, #{params[:email]} JUST SIGNED UP FOR #{params[:list]}!", :body => "Totally not joking--")
end

Any thoughts would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:42:10+00:00Added an answer on May 17, 2026 at 6:42 pm

    I would add validation to the email address field on the server side at least, but you can do initial verification on the client side as well (using a regex or jQuery Validation).

    If the email field does not contain a valid email address, do not submit the request to add the member.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form which is using ASP.NET MVC 3 unobtrusive client side
I have a simple winforms application in VB.NET 2008. I am using a form
I have a simple form that is used to update an entity in my
I have a form I am submitting using jQuery's ajaxSubmit function from the Forms
I don't code in PHP, but I have this form which I pulled off
I have a simple ASP.NET web form as below: <form id=form1 runat=server> <asp:TextBox ID=txt
I have a pretty simple ASP.NET MVC page and am using TinyMCE to allow
This sure seems like a simple error to fix. However, I somehow can't figure
Has anyone tried the ActiveRecord Intro Sample with C# 3.5? I somehow have the
I have somehow misconfigured fingers. This leads to a very annoying situation. I select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.