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

  • Home
  • SEARCH
  • 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 8370901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:01:30+00:00 2026-06-09T14:01:30+00:00

I am developing a simple Dojo application. I have a bit of a problem

  • 0

I am developing a simple Dojo application. I have a bit of a problem with my forms.
I have a form like this:

<form data-dojo-type="dijit.form.Form" data-dojo-attach-point="loginForm" method="POST">
      <label for="${id}_login">Login</label>
      <input name="login" id="${id}_login" data-dojo-attach-point="login" data-dojo-type="dijit.form.ValidationTextBox" data-dojo-props="required:true"/>
      <label for="${id}_password">Password</label>
      <input name="password" id="${id}_password0" data-dojo-attach-point="password" data-dojo-type="app.ValidationPassword" />
      <input type="submit" data-dojo-attach-point="loginButton" data-dojo-type="app.BusyButton" label="Login!" />
</form>

In the app I have:

 this.loginForm.onSubmit = function(e){

   // Do Ajax calls etc.
   // ..

   // Prevents actual submission
   return false;
 }

However, if anything goes wrong with the Javascript before that “return false”, the form is actually submitted, which results in an error (my node app will return Cannot POST /login as there is no POST action defined for that URL).

How can I make 1000% sure that the form doesn’t get submitted in any case? I know I could get rid of the tag altogether since I do everything with Ajax, but… then I wouldn’t get the nice data = that.loginForm.getValues(); for example. (I mean, it is a form after all)

(NOTE: I am NOT interested in non-javascript downgrading, really. The app is a 1-page ajax app, and there is no point in getting it to work if the user doesn’t have AJAX) )

  • 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-09T14:01:31+00:00Added an answer on June 9, 2026 at 2:01 pm

    preventDefault will stop the browser from performing the default action (ie: submitting).

    this.loginForm.onSubmit = function(e){
      e.preventDefault();
    
      // Do Ajax calls etc.
      // ..
    }
    

    See here for more information.

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

Sidebar

Related Questions

Im developing a simple application that have a line like this: string[] values =
I'm developing a simple Android application that would have an action bar on the
im developing a simple Mxml application using flex 3. I have used simple text
I'm developing a simple JSF application, but I'm stuck again... Basically, I have a
Hi I am developing a simple application based upon ASP.NET MVC. I have altered
I'm developing simple C# application using Windows.Forms on .NET. I need some button that
Developing a simple application. With a webview inside a window, loading a url. This
I am developing a simple students information application. I have student list in my
I am developing a simple pyramid application where I am using JQuery to do
I'm developing a simple product catalog in Titanium and I have a TableView with

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.