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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:30:17+00:00 2026-06-16T10:30:17+00:00

I have the following jQuery functions: Submits the form $(".content").delegate(‘.entryButton’,’click’, function() { var form

  • 0

I have the following jQuery functions:

  1. Submits the form

    $(".content").delegate(‘.entryButton’,’click’, function() {
    var form = $(this).closest("form");
    var id = form.attr(‘id’);
    var text = form.find("textarea").val();
    Sijax.request(‘add_entry’, [id, text]);

         //Prevent the form from being submitted (default HTML)
         return false;
     });
    
  2. Enlarge the form and show the entry button

    $("textarea").focus(function() {
    $(this).css(‘height’, ’80px’);
    var button = $(this).parent().next().children();
    button.css(‘visibility’, ‘visible’);
    button.css(‘height’, ’20px’)
    });

  3. Makes the textarea smaller and hides the button

    $("textarea").blur(function() {
    $(this).css(‘height’, ’30px’);
    var button = $(this).parent().next().children();
    button.css(‘height’, ‘0px’)
    });

This happens when I try to make an entry:

  • Click in the field (focus event), the field grows larger and shows the entry button
  • Enter text
  • Click on the entry button first time: Now the blur event fires which makes the field smaller again but the click event doesn’t fire
  • If I click the button again the form does submit

I think this means the blur and click event interfere with each other?

You can find a fiddle of the problem here. When you press the button with the field focused, it blurs the field but doesn’t enter it. When you press the button with the field blurred the entry does get submitted.

Any ideas?

  • 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-16T10:30:18+00:00Added an answer on June 16, 2026 at 10:30 am
    $('.entryButton').on('click', function (e) {
        return false; // to prevent default form post
    });
    $("form").delegate('.entryButton','mousedown', function() {
        $('textarea').trigger('blur');
        var form = $(this).closest("form");
        var id = form.attr('id');
        var text = form.find("textarea").val();
        $("#test").append(text);                 
    
        //Prevent the form from being submitted (default HTML)
        return false;
    });
    

    and keep the focus and blur function as before.

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

Sidebar

Related Questions

Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
I have a jQuery function that submits a form via menu navigation functions: $(function
I have the following jquery function that submits to an iframe. The message sent
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following jquery script: $(function(){ $('#top-menu').on('click', 'a.change-menu', function(e){ e.preventDefault() $(#menu-change-div).load($(this).attr(href)); }); });
I have the following scenario jQuery('#content').fadeOut('slow',function(){ jQuery('#content').load(detail.php?product=+imgID+&category=+cat); jQuery('#content').fadeIn('fast'); }); My problem however is that
I have the following jQuery code: $('.save').submit(function(e){ var formElement = $(this); var data =
I have the following jQuery functions: <script type=text/javascript> $(function() { // setTimeout() function will
I have a simple signup form with the following jQuery validation code: $(document).ready(function(){ $(#registerForm).validate({
All, I have the following jQuery code: jQuery(#data_form).submit(function() { event.preventDefault(); alert(it submits); }); When

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.