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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:22:28+00:00 2026-06-11T21:22:28+00:00

I have a form that when I submit it will check for some validation

  • 0

I have a form that when I submit it will check for some validation through jQuery AJAX call.

My code is like this:

$("#myForm").submit(function(){
    .....
    .....
    .....
    .....
    .....

    $.ajax({
        type:"POST",
        url:"<?php echo base_url();?>bTransJual/formTambahJual/ajaxCekStockJual/",
        data:  { prdIdUkuId: dataArrPrIdUkuId, qty: dataArrQty},
        dataType : "json",            
        success: function(data){
           if(data.sukses){
              //validasi lolos
              document.frmTransJual.submit();                                             
           }else{
              //validasi gagal
              psnErrNya = data.psnErr;
              $("#psnNotifikasiAjax").html(psnErrNya);
              $("#notifikasiAjax").show('normal');
              $("#imgLoadSubmit").hide();                                       
              return false;
           }
        }
     });
});

And my form tag:

<form name="frmTransJual" id="myForm" method="post" action="some_url.php">

If the ajax success it will return a value data, and if this data.sukses is true I want the form to submit it. i use document.frmTransJual.submit(); to submit it, but it doesn’t work. anybody have a solution for this?

  • 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-11T21:22:29+00:00Added an answer on June 11, 2026 at 9:22 pm

    The reason is that you are using a infinite loop.It will call the same funciton again.

    you can use like this

    create a div

     `<div id="submit">Submit form</div>`
    
    
     $("#submit").click(function(){
    $.ajax({
        type:"POST",
        url:"<?php echo base_url();?>bTransJual/formTambahJual/ajaxCekStockJual/",
        data:  { prdIdUkuId: dataArrPrIdUkuId, qty: dataArrQty},
        dataType : "json",            
        success: function(data){
           if(data.sukses){
             $("myform").submit();                                             
           }else{
              //validasi gagal
              psnErrNya = data.psnErr;
              $("#psnNotifikasiAjax").html(psnErrNya);
              $("#notifikasiAjax").show('normal');
              $("#imgLoadSubmit").hide();                                       
              return false;
           }
        }
     });
    

    })

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

Sidebar

Related Questions

I have an HTML form that needs multiple submit buttons, like this: <input type=submit
I would like to have a form that can submit to two different action
I have an Ajax form that updates a div when submitted with a submit
I have a form on a webpage that I submit using the jquery form
I have a form validation method that's called on submit. It executes a get
I have that code: jQuery(document).ready(function () { // binds form submission and fields to
I have this issue with my form that once its submitted, you will get
In my iOS application I have made a form that should submit data into
I want to submit a form that have many checkboxes with different values, using
I have a html form that posts to a new page on submit. If

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.