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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:54:53+00:00 2026-05-23T20:54:53+00:00

I am working on a website which basically has a form and includes a

  • 0

I am working on a website which basically has a form and includes a JS file: http://assets.sprint.degreesearch.org/assets/defaults.js?1311179143

What I am trying to do is dynamically apend an extra function on form submit (either via onclick function on submit button or via overwriting the functions included in the JS which gets triggered on form submit.

The problem is I am not very familier with Prototype.js and I am unable to execute a function on form submit. When its on onclick, it do triggers but immediately gets canceled by prototype i believe and its execution is stopped mid way.

The website in question is Step4 of http://sprint.degreesearch.org/collegefunnel website, where on Step4, while pressing Submit, I want to run a JS function which ideally takes around 200-300ms

Any pointers how I can unbind the event associated with mouse press and insert my dynamic script ahead of it and then bind back whatever has been bound by default

  • 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-23T20:54:53+00:00Added an answer on May 23, 2026 at 8:54 pm

    Prototype has a stopObserving method for unbinding events. Depending on where the events are being bound, you could call stopObserving on the form submit or the other elements’ mouse events.

    However, I don’t think that’s really the problem here. When you say you want to run a JS function which takes 200-300ms, I get confused. All JavaScript is synchronous, so the time it takes to execute is irrelevant. I suspect that there’s an unstated requirement that the function in question is really an asynchronous call which may not return for that period of time.

    In that case, what you really want to do is cancel the form submission. The form submission could be happening in one of two ways: either it’s a natural form submission, or is in effect triggering an asynchronous call of some kind.

    If it’s a natural form submission, you can bind a new event handler to the form’s submit action and call event.preventDefault() to stop the browser from posting to the server. Then later, call .submit() on the form to kick it off again.

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

Sidebar

Related Questions

I am working on a website which already has user access set up so
I am working on a website which is hosted on a server that has
I'm working on an ASP.NET website which targets desktop browsers. We want to enable
I was working with a online game website. There are some event which call
I am working on a website that currently has a number of disparate search
I'm working on a website which takes payment from a customer. I'm using Kohana
Hey I am completely lost with this one. Basically the website i'm working on
I am working on a website which sells books and journals. My problem is
I am working on a website which loads its data via AJAX. I also
I'm working on upgrading a website completely. The current website has a blog set

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.