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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:08:46+00:00 2026-05-19T05:08:46+00:00

I have javascript like http://jsfiddle.net/8JXTk/1/ just a snipplet … $dialog.dialog({ title: Add Link, buttons:

  • 0

I have javascript like

http://jsfiddle.net/8JXTk/1/

just a snipplet …

$dialog.dialog({
  title: "Add Link",
  buttons: {
    "Add Link": function() {
      var $this = $(this);
      if ($this.valid()) {
        alert($this.find("input[name=txtURL]").val());
      } else {
        $this.find("input.error:first").effect("highlight").focus();
      }
    },
    "Cancel": function() {
      $(this).dialog("close");
    }
  },
  open: function() {
    $this = $(this);
    $this.find("input[name=txtURL]").val("http://").focus();
  }
});

as you can see the handler for cancel button is just to close the dialog. why is the validation running when I cancel the dialog? (When you cancel, you can see the flash of the error appearing)

  • 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-19T05:08:46+00:00Added an answer on May 19, 2026 at 5:08 am

    Replace

    $dialog.validate({
    

    with

    $('.markdownEditorDialogs').validate({
    

    You are validating the dialog, but you must validate just the form you created.

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

Sidebar

Related Questions

This is JavaScript regex. regex = /(http:\/\/[^\s]*)/g; text = I have http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd and I
I'm creating my own JavaScript Array-like object and I have methods that call closures.
Ok, I have one JavaScript that creates rows in a table like this: function
Like the Delicious submission bookmark-let, I'd like to have some standard JavaScript I can
I'd like to execute JavaScript code from within a C# assembly and have the
I have a one-dimensional array of strings in JavaScript that I'd like to turn
I would like to compare two dates in javascript. I have been doing some
I have stumbled into several methods of looping in JavaScript, what I like the
Possible Duplicate: Escape string for use in Javascript regex I have a msg like
In Javascript, I have a certain string, and I would like to somehow measure

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.