logo
down
shadow

jquery.unobtrusive-ajax.js is not capturing the Submit event


jquery.unobtrusive-ajax.js is not capturing the Submit event

By : Simke
Date : November 22 2020, 10:31 AM
I wish did fix the issue. I did some more research (I changed how I described what I was looking for) and found this.
MVC 3 - Ajax.BeginForm does a full post back
code :
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>


Share : facebook icon twitter icon
jQuery submit is not catching submit event after ajax loading of content

jQuery submit is not catching submit event after ajax loading of content


By : Andrey Corj
Date : March 29 2020, 07:55 AM
I hope this helps . Update
As of jQuery 1.7, the .live() method is deprecated. It will be removed in jQuery 1.9. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().
code :
$("form").live('submit' , function() { 
    alert("Form submitted!");       
    return false;
});

$('.popup-container').load(url);
jQuery submit() and AJAX event; How can I trigger a regular form submit?

jQuery submit() and AJAX event; How can I trigger a regular form submit?


By : MrTumble
Date : March 29 2020, 07:55 AM
should help you out Instead of binding to the submit event of your form, bind to the click event of the submit button instead. This way you can catch the click event of the submit event and return false when you need to, or proceed with the submit() event on the form.
code :
​$('input[type="submit"]').click(function(e){
    e.preventDefault();
    if() // invalid data
    {

    }
    else // good to go
    {
        $('form').submit();
    }
})​
jQuery unobtrusive validation ignores "cancel" class on submit button if used in Ajax form

jQuery unobtrusive validation ignores "cancel" class on submit button if used in Ajax form


By : Liton Sarkar
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further That's a known limitation of Microsoft's unobtrusive ajax script. You could modify it to fix the bug. So inside the jquery.unobtrusive-ajax.js script replace the following on line 144:
code :
$(form).data(data_click, name ? [{ name: name, value: evt.target.value }] : []);
$(form).data(data_click, name ? [{ name: name, value: evt.target.value, className: evt.target.className }] : []);
if (!validate(this)) {
if (clickInfo[0].className != 'cancel' && !validate(this)) {
jquery.unobtrusive-ajax.d.ts / jquery.validate.unobtrusive.d.ts anyone?

jquery.unobtrusive-ajax.d.ts / jquery.validate.unobtrusive.d.ts anyone?


By : Stephan De Spiegelei
Date : March 29 2020, 07:55 AM
Hope this helps If you haven't got type information, and the compiler can't infer a type then there will be a problem.
Although you are getting output from the command line I would still expect it to give an error. Web Essentials enforces things more strongly, which is the idea behind the tooling.
code :
interface JQueryStatic {
    validator: any;
}
how to stop postback or submit event for jQuery Unobtrusive validation

how to stop postback or submit event for jQuery Unobtrusive validation


By : johnSabre
Date : March 29 2020, 07:55 AM
hop of those help? By default, the submit event is always blocked by jQuery Validate on an invalid form. If that's not happening, then you're not using the plugin properly.
code :
$(document).ready(function () {

    $("#addCustomer").click(function () {

        $("#myForm").validate();

        if ($("#myForm").valid()) {
        ....
$(document).ready(function () {  // DOM ready

    $("#myForm").validate({  // initialize the plugin
        submitHandler: function(form) {  // fires on valid form
            alert('yes valid');
            //$.post(...post my data using ajax..)
            alert('data posted successfully.');
            //clear form to submit another data
            clearForm();  // <- I don't see this function in your OP
            return false;
        }
    });  

});   
    $("#addCustomer").click(function () {  // capture click

        $("#myForm").submit(); // trigger validation test & submit
        ....
<input type="submit" ...
<button type="submit" ...
Related Posts Related Posts :
  • How to get font-size, written in CSS?
  • HTML div becomes hidden when including jqueryUI.js when using JQuery Mobile
  • Why is this jquery easing sample not working in JSFiddle?
  • TabIndex - hitting tab moves me to Address Bar - unable to work around this using Focus
  • Create JSON from string, to use as object
  • Jquery - How do I make ifModified:true work in .ajax request?
  • Jquery and create html on the fly
  • jQuery Validation not validating on button click
  • Jquery Draggable/Droppable appending multiple divs
  • jQuery selector not working properly. Possible Sizzle bug?
  • enable anchor in twitter bootstrap modal
  • jQuery keydown : Wait for previous event to finish
  • why magnific popup ajax box closes if clicked on content
  • JQPlot pie charts "jqplotDataClick" event fires multiple times
  • Show div as the page scrolls on div height
  • Keypress event for ajax call does not work
  • responsive/fluid jQGrid with Twitter Bootstrap
  • IE10 does not seem to fire load event
  • Remove tipTip tool tip
  • jquery datepicker changing unavailable dates in one instance
  • TableTools plugin export buttons are not working
  • Prepopulate jquery token input textbox
  • Open a fancybox link with ajax
  • Getting jQuery and AngularJS content assist / auto-complete in eclipse for standalone HTML "file"
  • TR alternate background colour with unequal number of TD
  • DATATABLE jQuery TH and TD alignment
  • Jquery UI Convert Select's to Range Slider
  • Change text in text field according to link that has been clicked
  • Animate addClass + removeClass transitions?
  • knockout ajax call data-BIND
  • How do I create a variable with a number based on an element's number position using jquery?
  • Prevent fixed position element from flickering during jQuery animation
  • points are not visible clearly in nvd3 ghaph
  • How to write a regular expression for IP address format
  • Animate 3 DIVs from right to left when page is loading.
  • How to pivot columns in free jqgrid 4.15.4
  • the jquery method works fine but when made as a function not working
  • Show/hide text doesn't work when targeting link within div
  • multiple autocomplete search input fields
  • Display image in cell using Jquery jTable
  • jQuery and Wordpress - Scripts not working
  • flickering when mouse over, .hover() show/hide div(s)
  • Using Django's JSONResponseMixin to respond to AJAX requests
  • Unable to render charts using Wicked PDF
  • Style to dynamically created elements
  • hover not working for items in list
  • Keep server session alive automatically based on activity / input, using JQuery
  • jQuery load() taking a long time
  • Change / Exchange values in textboxes on text change in jquery
  • Unslider arrow code overriding slider options
  • what is the traditional way of sorting search results?
  • Do the action when the DIV comes in the display area of the browser with jQuery
  • jQuery slideshow overlapping CSS ribbon
  • JQuery animate function dont work
  • problems charts jquery highcharts
  • How to reset the select box values in Jquery sumoselect Multi select plugin
  • css absolute position on top of another element
  • How use jQuery String variable in html body
  • Get a row from table in view on modal bootstrap using codeigniter
  • How to make the effect of a div that covers an other div when scrolling?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org