Before you ask please READ THIS

Comments not getting submit at once

edited November 2012 in Airborn Posts: 10
Hi Support Team,

I am seeing when i try to post comments and click on "Submit Comments" button , it doesn't get submit on the first click and i have to click twice then the comments get submit to the blog.

i have seen the same thing on your demo too , can we fix it

this is one of my website blog post: http://www.urecomm.com/pandora-jewelery-luxury-jewelery-with-a-personal-touch

Comments

  • AirAir
    Posts: 10,970
    Hello aamir.

    I am sorry to say but we don't longer support or develop Airborn. This bug is connected with JavaScript form validation. Shame no one noticed it earlier:-/

    With kindly regards.
  • AirAir
    Posts: 10,970

    You could try to edit airborn/common/js/scripts.js in line ~301 and change this code

    if($(this).hasClass('validated')){
                    return true;
                }
                else{
                    e.preventDefault();
                    error_number = 0;

                    $(this).find('input.required, textarea').each(function(){
                        if( $.trim( $(this).val() ) == '' ){
                            $(this).parent().addClass('error');
                            error_number++;
                            return;
                        }
                        
                        if( $(this).hasClass('email') ){
                            var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
    //                        alert($(this).val() + ' ' + $(this).val().search(emailRegEx));
                             if ($(this).val().search(emailRegEx) == -1) {
                                $(this).parent().addClass('error');
                                error_number++;
                                return;
                            }
                        }
                        
                        // everythin ok
                        $(this).parent().removeClass('error');
                    });
                    
                    if( error_number == 0 ){
                        if( $('#url').val() == $('#url').attr('title') ){
                            $('#url').val('');
                        }
                        $(this).addClass('validated').submit();
                    }
                    
                }

    to

    error_number = 0;

                $(this).find('input.required, textarea').each(function(){
                    if( $.trim( $(this).val() ) == '' ){
                        $(this).parent().addClass('error');
                        error_number++;
                        return;
                    }
                    
                    if( $(this).hasClass('email') ){
                        var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
    //                        alert($(this).val() + ' ' + $(this).val().search(emailRegEx));
                         if ($(this).val().search(emailRegEx) == -1) {
                            $(this).parent().addClass('error');
                            error_number++;
                            return;
                        }
                    }
                    
                    // everythin ok
                    $(this).parent().removeClass('error');
                });
                
                if( error_number == 0 ){
                    if( $('#url').val() == $('#url').attr('title') ){
                        $('#url').val('');
                    }
                }
                else{
                    e.preventDefault();
                }
  • Posts: 10
    No :(
    when i changed it , it disturb images on post
    i have replaced exact the same codes
  • AirAir
    Posts: 10,970
    Images? Then you must did something wrong, probably ate one of } and whole JavaScript broken.

    Check carefully.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!