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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:32:46+00:00 2026-05-31T00:32:46+00:00

I try to do something and it works with few exceptions… I have a

  • 0

I try to do something and it works with few exceptions… I have a form which sends data throught $.ajax() but sometimes the form sends the data twice or three times…

The code is:

$('div#feedBackPresta-image, div#feedBackPresta-fb').click(function() {
    $('div#bgLayer').css({
        'height': bodyHeight,
        'display': 'block'
    });
    $('div#feedBack').css('display', 'block');
});
$('a#addFeedBack').click(function() {
    $('div#feedBacks').css('display', 'none');
    $('h3#clientsAboutUs').css('display', 'none');
    $('h3#addFeedBackAboutUs').css('display', 'inline-block');
    $('div.pages').css('display', 'none');
    $('div#feedBackForm').css('display', 'block');
    $('a#showFeedBacks').css('font-weight', 'normal');
    $('a#addFeedBack').css('font-weight', 'bold');
    $('input#submitFeedBack').attr('disabled', 'disabled');
    var clientName = $('input#clientName').val();
    var clientEmail = $('input#clientEmail').val();
    var clientWebsite = $('input#clientWebsite').val();
    var clientImage = $('input#clientImage').val();
    var clientFeedBack = $('textarea#clientFeedBack').val();
    var error = false;
    $('input#clientName, input#clientEmail, input#clientWebsite, input#clientImage, textarea#clientFeedBack').focusin(function() {
        $('input#clientName, input#clientEmail, input#clientWebsite, input#clientImage, textarea#clientFeedBack').keyup(function() {
            if($('input#clientName').val().length < 6) {
                $('input#clientName').css('border', '1px solid #ff0000');
                error = true;
            }
            else {
                $('input#clientName').css('border', '1px solid #BDC2C9');
                error = false;
            }
            if($('input#clientEmail').val().length < 10) {
                $('input#clientEmail').css('border', '1px solid #ff0000');
                error = true;
            }
            else {
                $('input#clientEmail').css('border', '1px solid #BDC2C9');
                error = false;
            }
            if($('textarea#clientFeedBack').val().length < 20) {
                $('textarea#clientFeedBack').css('border', '1px solid #ff0000');
                error = true;
            }
            else {
                $('textarea#clientFeedBack').css('border', '1px solid #BDC2C9');
                error = false;
            }
            if(error == false) {
                $('input#submitFeedBack').removeAttr('disabled');
            }
            else {
                $('input#submitFeedBack').attr('disabled', 'disabled');
            }
        });
    });
    $('input#submitFeedBack').click(function() {
        clientName = $('input#clientName').val();
        clientEmail = $('input#clientEmail').val();
        clientWebsite = $('input#clientWebsite').val();
        clientImage = $('input#clientImage').val();
        clientFeedBack = $('textarea#clientFeedBack').val();
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
        if(clientEmail != "" || clientEmail != undefined) {
            if(!emailReg.test(clientEmail)) {
                $('input#clientEmail').css('border', '1px solid #ff0000');
                error = true;
            } 
        }
        if(error == false) {
            $.ajax({
                type: 'POST',
                url: 'modules/feedBackPresta/ajax.php',
                data: {'type': 'add', 'clientName': clientName, 'clientEmail': clientEmail, 'clientFeedBack': clientFeedBack, 'clientWebsite': clientWebsite, 'clientImage': clientImage},
                success: function() {
                    $('input#submitFeedBack').attr('disabled', 'disabled');
                    $('input#clientName').val('').css('border', '1px solid #BDC2C9');
                    $('input#clientEmail').val('').css('border', '1px solid #BDC2C9');
                    $('input#clientWebsite').val('');
                    $('input#clientImage').val('');
                    $('textarea#clientFeedBack').val('').css('border', '1px solid #BDC2C9');
                    $('div#successAdd').append('<div class="feedBack-approve" style="text-align: center;"><p style="margin-top: 15px;">Successful!</p></div>');
                    $('div.feedBack-approve').fadeOut(2500);
                }
            });
        }
    });
});
$('a#showFeedBacks').click(function() {
    $('div#feedBackForm').css('display', 'none');
    $('h3#clientsAboutUs').css('display', 'inline-block');
    $('h3#addFeedBackAboutUs').css('display', 'none');
    $('div.pages').css('display', 'block');
    $('div#feedBacks').css('display', 'block');
    $('a#addFeedBack').css('font-weight', 'normal');
    $('a#showFeedBacks').css('font-weight', 'bold');
});
$('div#bgLayer, div#feedBackRight').click(function() {
    $('div#bgLayer').css('display', 'none');
    $('div#feedBack').css('display', 'none');
    $('div#feedBacks').css('display', 'block');
    $('div#feedBackForm').css('display', 'none');
    $('a#showFeedBacks').css('font-weight', 'bold');
    $('h3#clientsAboutUs').css('display', 'inline-block');
    $('h3#addFeedBackAboutUs').css('display', 'none');
    $('div.pages').css('display', 'block');
    $('a#addFeedBack').css('font-weight', 'normal');
    window.location.hash = '!';
});
$('a.anchors').click(function() {
    $('div#bgLayer').css('display', 'none');
    $('div#feedBack').css('display', 'none'); 
});

So if anybody can help me with this code I’ll be very grateful…

Best regards,
George!

  • 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-31T00:32:47+00:00Added an answer on May 31, 2026 at 12:32 am

    Form submission via the .submit() event rather than a .click() event in jQuery may help avoid this. Your code should be roughly the same, just add return false to the bottom of the .click() method and rename it .submit()

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

Sidebar

Related Questions

I would try something like this but it isn't allowed. function GetDynamicModulesProperties() { var
I'm pretty proficient in PHP, but want to try something new. I'm also know
I'm trying to debug an issue. We have few Threads that work on data
I have tried for a few days now to figure this out but i
Every time I try to do something seemingly-simple in CSS, it doesn't work. I
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger(component)
I want to do something like this... try { # Something in this function
If I want to try out something new in Ruby or Javascript, I love
I try to do something pretty strait... getting php value to javascript here is
whenever I try to run something in Java, Eclipse changes into the PHP perspective.

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.