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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:57:59+00:00 2026-05-28T16:57:59+00:00

I am going to submit a form after validating the form as follows, here

  • 0

I am going to submit a form after validating the form as follows, here first I use a ajax post and check whether duplicate values are exist if exist ajax will return html code else return ‘false’. Dialog box should popup if ajax return is a ‘html code’. If ajax return is false form_validate() should return true. Which means no duplicates, form will submit for insert data. If user clicked Ok on the Dialog box, form_validate() should return true which means there are duplicates, form will submit for update data. If user clicked Cancel form_validate() should return false which means form will not submit. I am working on this hours but couldn’t figure it out. Plz Help.

   function form_validate(){

         $.post('index.php',{ .....

                             },function(result){ 

                                if(result!='false'){
                                  $('<div></div>')
                                          .html(result+'<br/>Click OK to confirm.  Click Cancel to stop this action.')
                                          .dialog({
                                                         buttons : {
                                                                "OK": function() { 
                                                                   $(this).dialog("close");                       
                                                                   return true;
                                                                 }, "Cancel": function() {
                                                                        $(this).dialog("close");
                                                                         return false;
                                                                 }
                                 }
                                   }


             });



        }

<form> Tag

<form action="index.php" method="post" name="adminForm" onsubmit="return validate_form();" >        
  • 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-28T16:58:00+00:00Added an answer on May 28, 2026 at 4:58 pm
    function form_validation(){
                 $.post
                  .....
                  .....
                ,function(result){        
    
    
    
                               if(result!='false'){
                                   $('<div></div>')   
                                          .html(result+'<br/>Click OK to confirm.  Click Cancel to stop this action.')   
                                          .dialog({   
                                       buttons : {
                                            "OK": function() { 
                                                  $(this).dialog("close");                       
                                                  $('#adminForm3').submit();
                                            }, "Cancel": function() {
                                                  $(this).dialog("close");
                                            }
                                       }});
                               }
                               else{                                  
                                   $('#adminForm3').submit();
                               }
                               return ;
    
                               });
    return false;
    }
    

    add form id as adminForm3. This will work fine.

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

Sidebar

Related Questions

Im trying to submit a form with Ajax here's my simplified code My index:
i have a form and want to submit it with a script. i'm going
i'm using the following code to submit a form: function submitfilter(){ alert(in here); var
I am working on an AJAX system to submit a form, but I can't
I am just going to submit my iphone application . But I just have
I have current a developed app which I am going to submit in just
Going from the example given here... http://ericswann.org/blog/archive/2009/04/06/linq-to-sql-datacontext-provider-revisited.aspx I'm trying to use the datacontext between
Going round in circles here i think. I have an activity called Locate; public
I have a form on which I use validation. This form has a section
I wrote like this. After submit click loop is not excuting. But I saw

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.