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 8604385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:33:38+00:00 2026-06-12T02:33:38+00:00

I have little problem with form and I am using js for validation. Here

  • 0

I have little problem with form and I am using js for validation.

Here is my form code.

<form method="get" onkeydown="checkEnter()" action="emailform.php" id="signupform" name="subscribe">
  <input name="email" id="email" type="text" value="Enter Email for Updates" onfocus="if(this.value=='Enter Email for Updates'){this.value=''};" />
  <input type="hidden" name="submitted" id="submitted" value="true" />
</form>

id signupform I am using for validation and submit the form is on pressing enter button.

But there is problem when put signupform then my validation start working fine and when I enter correct email it’s show me error and when I remove the signupform id then my form submission work fine without validation.

Here is my JS code for id signupform.

function SubscribeForm() {
  $('#signupform').submit(function () {
    $('.email').removeClass('error')
    $('em.error').remove();

    var error = false;
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

    if ($.trim($('.email').val()) == '') {
      $(this).append('<em class="error">Please enter your email address.</em>');
      $(this).addClass('error');
      error = true;
    } else if (!emailReg.test(jQuery.trim($('.email').val()))) {
      $(this).append('<em class="error">Please enter a valid email address</em>');
      $(this).addClass('error');
      error = true;
    }
    if (!error) {
      $("#submit", this).after('<span id="form_loading"></span>');
      var formValues = $(this).serialize();

      $.post($(this).attr('action'), formValues, function (data) {
        $("#signupform").before(data);
      });

      $(':input[type="text"]').attr('value', '');
    }
    return false
  });
}
  • 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-06-12T02:33:39+00:00Added an answer on June 12, 2026 at 2:33 am

    Thanks for your help Guys. i just put this and now working fine.

    $('#signupform').submit(function(){
            $('.email').removeClass('error')
            $('em.error').remove();
            var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
            sEmail = document.getElementById('email').value;
            if (filter.test(sEmail)) {
    
                return true;
            }
            else {
                if(sEmail == '')
                {
                    $(this).append('<em class="error">Please enter your email address</em>');
                    $(this).addClass('error');
                }
                else
                {
                    $(this).append('<em class="error">Please enter a valid email address</em>');
                    $(this).addClass('error');
                }
                return false;
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem with javascript form submit issue, here is the script
I am newbie using jquery mobile with php. I have a little problem on
I have a little problem with Jquery getJSON function. my json here { entries:
I have a little problem. This is my code: stackPanelShapesContainer = new StackPanel(); InitializeStackPanle();
i have a little problem with my java socket code. I'm writing an android
I have a little problem about Google Maps. I'm using Geocoding (xml) for getting
I have a little problem with paperclip saving the data passed through the form...
I'm totally newbie in javascript/jQuery and i have a little problem :) I'm using
I have a little problem with an upload-form within an other form (call it
i have created little search method. The problem that its hard to read it

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.