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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:11:52+00:00 2026-05-30T03:11:52+00:00

I have this form: <div class=row border-tb> <form id=test-form action=/test/insert method=post class=form-inline offset4 span16>

  • 0

I have this form:

            <div class="row border-tb">
                <form id="test-form" action="/test/insert" method="post" class="form-inline offset4 span16">
                    <div class="box-suggest span13 border-tb">
                        <input type="text" name="test" value="" id="test" class="span13" placeholder="proviamo con il test"/>
                    </div>
                    <button style="margin-left: 5px;" id="send-button" type="submit" class="btn"> <i class="icon-plus"></i> </button>
                </form>
            </div>

and this mootools event for capture keyup:

            $('test').addEvent("keyup",function(event){
                event.stop();
                alert("Why after this alert redirect on url: test/insert ??????");
            })

My problem is that event.stop() doesn’t prevent form submit when I press ENTER key.

I have try also event.stopPropagation() and event.preventDefault() but nothing. It always redirect on url: “test/insert” when I press ENTER key.

Why?

  • 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-30T03:11:53+00:00Added an answer on May 30, 2026 at 3:11 am

    That’s because the event is fired on keydown as well, and then a submit event is fired on the form.

    Try to add this:

    $('test-form').addEvent("submit",function(event){
       event.stop();
       return false;
    });
    

    ==================

    Edit

    The above will prevent all form submitions, since this is probably not what you’re after, here’s a better simpler solution:

    $('test').addEvent("keydown",function(event){
        event.stop();
        alert("Why after this alert redirect on url: test/insert ??????");
        return false;
    })
    

    I did not write it before since you might actually need the key UP event and not DOWN, but this just makes more sense.

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

Sidebar

Related Questions

this is the form <form action=j_security_check method=post> <div id=editForm> <h2>Login</h2> <div class=errors></div> <div class=row>
Basic question; I have this code: var partipiansRow = '<div class=form-row ><input type=text id=name
I have this as template account_form.html <form action=/contact/ method=post> {% for field in form
I have this fairly simple form: <form action=...> <div> <input type=text class=input-text value= name=text
I have a form that looks kind of like this: <div> <div class=contact> <h1>Person's
Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
I have this form in my view: <!-- Bug (extra 'i') right here-----------v -->
I have this form: <form name=customize> Only show results within <select name=distance id=slct_distance> <option>25</option>
I have this form. Basically what I want is to send a auto-response with
I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',

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.