• Hi ( Hallo ),
    I am going to report in english, so it’s more widely understandable ^^.

    I noticed, that if you wanna submit the form, without any information filled out it for example, the first time the form responds the correct way and shows the relevant message, in this case “please fill out the required fields”.
    But if you just hit the send button the 2nd time, the click-handler is not triggered and a page-reload occurs, which can be misleading.

    If you need any more information, just let me know.

    Cheers,
    Sahin

Viewing 2 replies - 1 through 2 (of 2 total)
  • I had the same issue. Solved it by slightly modification of form.js:

    
    var haet_cleverreach = haet_cleverreach || {}; 
    
    var haet_submitForm = function( $form ) {
            var submission = {}; 
            $form.find('.cleverreach-loader').slideDown(400);
            $form.find('[name]').each(function(){
                var $field = $(this);
                submission[$field.attr('name')] = $field.val();
            })  
    
            var data = { 
                'action': 'cleverreach_submit',
                'submission': submission
            };  
    
            $.post(ajax_object.ajax_url, data, function (response) {
                $('.haet-cleverreach').replaceWith(response);
                haet_registerFormEvent();
            }); 
    
            return false;
    };
    
    var haet_registerFormEvent = function () {
        $('.haet-cleverreach-form').submit( function( event ) {
           return haet_submitForm( $( this ) );
        });
    };
    
    jQuery(document).ready(function($) {    
        haet_registerFormEvent();
    });
    
    • This reply was modified 7 years, 9 months ago by Lars Kosubek.
    Thread Starter ?ahin

    (@flyinghawk)

    @larskosubek
    Thanks for that! I also did a similar modification, but I guess it would be good if the author would resolve this issue anyway.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Submission not prevented, if clicked twice’ is closed to new replies.