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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:38:59+00:00 2026-05-31T12:38:59+00:00

So, in this question I explained my whole situation and to save space I

  • 0

So, in this question I explained my whole situation and to save space I am not going to repost my whole situation

But here is the answer to the question that I am having problems with

    function form_submit (event) {

var form, bClickNotSubmit;

if (event  &&  event.type == 'click') {
    bClickNotSubmit = true;
    form            = document.getElementById ('quick_reply_form');
}
else {
    bClickNotSubmit = false;
    form            = event ? event.target : this;
}

var arTextareas = form.getElementsByTagName ('textarea');

for (var i = arTextareas.length - 1; i >= 0; i--) {
    var elmTextarea     = arTextareas[i];
    elmTextarea.value   = "[font=Tahoma][color=white]" + elmTextarea.value + "[/color][/font]";
}

if ( ! bClickNotSubmit ) {
    form._submit();
}
    }

    window.addEventListener ('submit', form_submit, true);
    document.getElementById ('quick_reply_submit').addEventListener ('click', form_submit, true);

    HTMLFormElement.prototype._submit = HTMLFormElement.prototype.submit;
    HTMLFormElement.prototype.submit = form_submit;

So this works all fine and dandy in firefox, but I have now realized that there is a issue in chrome. When it quick reply form is submitted on the page, the function seems to run, in the sense that you can see the stuff get added to the beginning and the end of the text, but it seems to not do it fast enough because the form gets submitted to the server before the text is added

does anyone know how to remedy this?

  • 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-31T12:39:01+00:00Added an answer on May 31, 2026 at 12:39 pm

    Not tested, but try changing this:

    if ( ! bClickNotSubmit ) {
        form._submit();
    }
    

    To this:

    if ( ! bClickNotSubmit ) {
        form._submit();
    }
    else {
        event.preventDefault ();
        event.stopPropagation ();
        return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Found this question that explained a way to communicate between layers. However there is
This question might not seem programming related at first, but let me explain. I'm
This question is general but I am going to give a specific example. The
I have a use case with NServiceBus explained in this question. Essentially there is
This is probably a basic question, better explained through code: public void checkStatus {
This question (along with its answer) explains why you can't easily bind a DataGridView
I postet this question a few days ago but I didn't explain exactly what
EDIT I added this note to explain why I keep this question here. I
I tried to ask this question before but I guess I didnt explain myself
OK, our professor explained (kinda) this problem, but it still doesn't make much sense.

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.