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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:22:33+00:00 2026-06-18T11:22:33+00:00

Im stuck on a JavaScript Issue, which I have no idea how to resolve.

  • 0

Im stuck on a JavaScript Issue, which I have no idea how to resolve.

I have a Contact Modal within a Blog: http://www.northernvirginiapaintingcontractor.com/blog Click “Send a Page”

When you click on this you will see the issue. The Contact Modal doesn’t open all of the way.

Compare that with the same “Send a Page” button on the Parent Application which functions normal. http://www.northernvirginiapaintingcontractor.com

This utilizes a modified version of Eric Martin’s Simple Modal.

The Contact.js was modified to enable dynamic height, as well as, several different Contact Modals to be utilized with the same script.

3 other .js files include:
actual.js
jquery-easing-1.3.pack.js
jquery-easing-compatibility.1.2.pack.js

Here is the contact.js that has the problem: I don’t have the slightest clue, if someone else does that would be great.

jQuery(function ($) {
var contact = {
    message: null,
    init: function () {
        $('#contact-form input.contact, a.contact').click(function (e) {
            e.preventDefault();

            // Create the 1stModal dialog with the data

            $('#modal-contact-form').modal({
                closeHTML: "<a href='#' title='Close' class='modal-close'>Close Pager Modal</a>",
                //maxHeight: 62,
                //maxWidth: 62,
                //minHeight: 62,
                //minWidth: 62,
                position: [98, 377],
                //autoPosition: false,
                autoResize: true,
                //overlayId: 'contact-overlay',
                containerId: 'contact-container',
                containerCss: { 'width': '350px'},
                onOpen: contact.open,
                onShow: contact.show,
                onClose: contact.close
            });
        });

        $('#contact-form input.suportecontacto, a.suportecontacto').click(function (e) {
            e.preventDefault();

            // Create the 2nd Modal dialog with the data

            $('#modal-soporte-form').modal({
                closeHTML: "<a href='#' title='Close' class='modal-close'>Close Ticket Modal</a>",
                //maxHeight: 62,
                //maxWidth: 62,
                //minHeight: 62,
                //minWidth: 62,
                position: [98, 377],
                //autoPosition: false,
                autoResize: true,
                //overlayId: 'contact-overlay',
                containerId: 'contact-container',
                containerCss: { 'width': '350px' },
                onOpen: contact.open,
                onShow: contact.show,
                onClose: contact.close
            });
        });

        $('#contact-indivform input.indivcontacto, a.indivcontacto').click(function (e) {
            e.preventDefault();

            // Create the 3rd Modal dialog with the data

            $('#modal-indivcontact-form').modal({
                closeHTML: "<a href='#' title='Close' class='modal-close'>Close Contacto Modal</a>",
                //maxHeight: 62,
                //maxWidth: 62,
                //minHeight: 62,
                //minWidth: 62,
                position: [98, 377],
                //autoPosition: false,
                autoResize: true,
                //overlayId: 'contact-overlay',
                containerId: 'contact-container',
                containerCss: { 'width': '350px' },
                onOpen: contact.open,
                onShow: contact.show,
                onClose: contact.close
            });
        });

        $('#HeadLogin').click(function (e) {
            e.preventDefault();

            // Create the Login modal

            $('#login_form').modal({
                closeHTML: "<a href='#' title='Cerrar' class='modal-close' style='padding-right:15px'>Cerrar Login Modal</a>",
                //maxHeight: 62,
                //maxWidth: 62,
                //minHeight: 62,
                //minWidth: 62,
                position: [110, 364],
                //autoPosition: false,
                autoResize: true,
                //overlayId: 'contact-overlay',
                containerId: 'contact-container',
                containerCss: { 'width': '310px' },
                onOpen: contact.open,
                onShow: contact.login,
                onClose: contact.close
            });
        });
    },
    open: function (dialog) {
        $('#ajax_loading').hide();
        $('.simplemodal-wrap').css('overflow-x', 'visible').css('overflow-y', 'visible');
        // add padding to the buttons in firefox/mozilla
        if ($.browser.mozilla) {
            $('#contact-container .contact-button').css({
                'padding-bottom': '2px'
            });
        }
        // input field font size
        if ($.browser.safari) {
            $('#contact-container .contact-input').css({
                'font-size': '.9em'
            });
        }

        // Dynamically determine Modal Height

        //var h = 280;
        //var h = 220;
        //if ($('#contact-subject').length) {
        //    h += 26;
        //}
        //if ($('#contact-cc').length) {
        //    h += 22;
        //}

        var h = $('#contact-container form').actual('outerHeight') + 30;

        var title = $('#contact-container .contact-title').html();
        $('#contact-container .contact-title').html('Loading...');
        dialog.overlay.fadeIn(200, function () {
            dialog.container.fadeIn(200, function () {
                dialog.data.fadeIn(200, function () {
                    $('#contact-container .contact-content').animate({
                        height: h
                    }, function () {
                        $('#contact-container .contact-title').html(title);
                        $('#contact-container form').fadeIn(200, function () {
                            $('#contact-container #contact-name').focus();

                            $('#contact-container .contact-cc').click(function () {
                                var cc = $('#contact-container #contact-cc');
                                cc.is(':checked') ? cc.attr('checked', '') : cc.attr('checked', 'checked');
                            });

                            // fix png's for IE 6
                            if ($.browser.msie && $.browser.version < 7) {
                                $('#contact-container .contact-button').each(function () {
                                    if ($(this).css('backgroundImage').match(/^url[("']+(.*\.png)[)"']+$/i)) {
                                        var src = RegExp.$1;
                                        $(this).css({
                                            backgroundImage: 'none',
                                            filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '", sizingMethod="crop")'
                                        });
                                    }
                                });
                            }
                        });
                    });
                });
            });
        });
    },
    login: function() {
    $('#contact-container .contact-send').click(function (e) {
            e.preventDefault();
        // Hide 'Submit' Button
     if (contact.validateLogin()) {
        $('.contact-send').hide();
        $('.contact-cancel').hide();

        // Show Gif Spinning Rotator
        $('#ajax_loading').show();

        // 'this' refers to the current submitted form  
        var url ='';
        var str = $('#frmlogin').serialize();
        var path = window.location.pathname;
        var sub = 'Account';


        if(path.toUpperCase().indexOf(sub.toUpperCase()) != -1) {
            url = 'Login.aspx';
            var image = $('#ajax_loading img');
            image.attr('src','../images/spinner.gif');
        }
        else {
            url = 'Account/Login.aspx';
        }

        // -- Start AJAX Call --
        var form = $('#status form');
        $.ajax({
            type: "POST",
            //url: form[0].action,
            url: url,
            data: str,
            success: function (msg) {


            $("#status").ajaxComplete(function (event, request, settings) {

                // Show 'Submit' Button
                $('.contact-send').show();
                $('.contact-cancel').show();
                // Hide Gif Spinning Rotator
                $('#ajax_loading').hide();

                if (msg != 'False') // LOGIN OK?
                {
                    var login_response = '<div style="color:green; margin: 1px; float: right; width: 300px;">Ya Estás Conectado!<br />Por favor, espera mientras estas redirigido...</div>';
                    $('.contact-title').hide();

                    $('a.modalCloseImg').hide();
                    $('#frmlogin').hide();

                    $('#simplemodal-container').css("width", "500px");
                    $('#simplemodal-container').css("height", "140px");

                    $('#login_form .contact-message').html(login_response).show();      // Refers to 'status'

                    // After 1 second redirect the Logged-in User 
                    setTimeout(contact.redirect, 500);
                }
                else // ERROR?
                {
                    $('#login_form .contact-content').css("height", "150px");

                    $('#login_form .contact-message').html("Login failed!").css('color','red').show();
                }

            });

        }

    });
    }
    // -- End AJAX Call --

    else {
                if ($('#login_form .contact-message:visible').length > 0) {
                    var msg = $('#login_form .contact-message div');
                    msg.fadeOut(200, function () {
                        msg.empty();
                        contact.showError();
                        msg.fadeIn(200);
                    });
                }
                else {
                    $('#login_form .contact-message').animate({
                        height: '30px'
                    }, contact.showError);
                }

            }
    });


    },
    redirect: function() {
        window.location = '/'; // Members Area
    },
    show: function (dialog) {
        $('#contact-container .contact-send').click(function (e) {
            e.preventDefault();

            var form = $('#contact-container form');

            // validate form
            if (contact.validate()) {
                var msg = $('#contact-container .contact-message');
                msg.fadeOut(function () {
                    msg.removeClass('contact-error').empty();
                });
                $('#contact-container .contact-title').html('Sending...');
                $('#contact-container form').fadeOut(200);

                $('#contact-container .contact-content').animate({
                    height: '80px'
                }, function () {

                    var uname = $('#contact-container #contact-name').val();
                    var email = $('#contact-container #contact-email').val();
                    var cntx = $('#contact-container #contact-message').val();

                    var docc = "false";
                    if ($('#contact-container #contact-cc').is(':checked')) {
                        docc = "true";
                    }

                    $.ajax({
                      url: "blog/api/Blogs.asmx/SendMail",
                      data: "{'uname':'" + uname + "', 'email':'" + email + "','cntx':'" + cntx + "','docc':'" + docc + "'}",
                      type: "POST",
                      contentType: "application/json",
                      success: function (msg) {
                         //contact.close(dialog);
                         $('#contact-container .contact-loading').fadeOut(200, function () {
                            $('#contact-container .contact-title').html('Thank you!');
                            msg.html(data).fadeIn(200);
                            setTimeout(function () {
                                contact.close(dialog);
                            }, 1500);
                        });
                      }
                   });

                    contact.close(dialog);
                });
            }
            else {
                if ($('#contact-container .contact-message:visible').length > 0) {
                    var msg = $('#contact-container .contact-message div');
                    msg.fadeOut(200, function () {
                        msg.empty();
                        contact.showError();
                        msg.fadeIn(200);
                    });
                }
                else {
                    $('#contact-container .contact-message').animate({
                        height: '30px'
                    }, contact.showError);
                }
            }
        });
    },


    close: function (dialog) {

        $('#contact-container .contact-message').fadeOut();
        $('#contact-container .contact-title').html('Closing...');
        $('#contact-container form').fadeOut(200);

        $('#contact-container .contact-content').animate({
            height: 40
        }, function () {
            dialog.data.fadeOut(200, function () {
                dialog.container.fadeOut(200, function () {
                    dialog.overlay.fadeOut(200, function () {
                        $.modal.close();
                    });
                });
            });
        });
    },
    error: function (xhr) {
        alert(xhr.statusText);
    },
    validateLogin: function () {
        contact.message = '';

        if (!$('#username').val()) {

             contact.message += 'User name is required. ';
        }

        var pass = $('#password').val();
        if (!pass) {

            contact.message += 'Password is required. ';
        }
        if (contact.message.length > 0) {
            return false;
        }
        else {
            return true;
        }

    },
    validate: function () {
        contact.message = '';
        if (!$('#contact-container input[name="name"]').val()) {
            contact.message += 'Name is required. ';
        }

        var email = $('#contact-container input[name="email"]').val();
        if (!email) {
            contact.message += 'Email is required. ';
        }
        else {
            if (!contact.validateEmail(email)) {
                contact.message += 'Email is invalid. ';
            }
        }

        if (!$('#contact-container textarea[name="message"]').val()) {
            contact.message += 'Message is required.';
        }

        if (contact.message.length > 0) {
            return false;
        }
        else {
            return true;
        }
    },
    validateEmail: function (email) {
        var at = email.lastIndexOf("@");

        // Make sure the at (@) sybmol exists and  
        // it is not the first or last character
        if (at < 1 || (at + 1) === email.length)
            return false;

        // Make sure there aren't multiple periods together
        if (/(\.{2,})/.test(email))
            return false;

        // Break up the local and domain portions
        var local = email.substring(0, at);
        var domain = email.substring(at + 1);

        // Check lengths
        if (local.length < 1 || local.length > 64 || domain.length < 4 || domain.length > 255)
            return false;

        // Make sure local and domain don't start with or end with a period
        if (/(^\.|\.$)/.test(local) || /(^\.|\.$)/.test(domain))
            return false;

        // Check for quoted-string addresses
        // Since almost anything is allowed in a quoted-string address,
        // we're just going to let them go through
        if (!/^"(.+)"$/.test(local)) {
            // It's a dot-string address...check for valid characters
            if (!/^[-a-zA-Z0-9!#$%*\/?|^{}`~&'+=_\.]*$/.test(local))
                return false;
        }

        // Make sure domain contains only valid characters and at least one period
        if (!/^[-a-zA-Z0-9\.]*$/.test(domain) || domain.indexOf(".") === -1)
            return false;

        return true;
    },
    showError: function () {
        $('#contact-container .contact-message')
            .html($('<div class="contact-error"></div>').append(contact.message))
            .fadeIn(200);
    }
};

contact.init();

});
  • 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-18T11:22:34+00:00Added an answer on June 18, 2026 at 11:22 am

    The simpleModal plugin programatically assigns the .simplemodal-wrap class
    with a height of 100%, but the jquery.actual plugin fails to find the correct
    height of the modal form during page resize because of this.
    As a work-around I re-set the min-height to a value that displays the full
    form no matter what.

    .simplemodal-wrap {
    min-height: 350px;
    height: auto !important; /* needed for IE6 and below /
    height: 350px; /
    needed for IE6 and below */
    }

    site.cshtml:

    The element at line 129:
    had a inline style == “display: none; “. This was not being changed to display: block; when the contact modal was opened. I chose to remove the inline style because one of the ancestor elements already has display: none; specified and when the modal opened that was being changed correctly.

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

Sidebar

Related Questions

I'm trying to create a javscript scroller following the example at: http://www.deadmarshes.com/Blog/jQuery+Slideshow+with+Crossfade.html Unfortunately this
I have a strange issue from a client in that our code, which they
I have a Javascript API, which should be usable with GWT and Flex. Using
I'm currently stuck on a JavaScript / JSF issue. The project I'm working on
Have been stuck with this issue for a few days now, and really need,
I have a study logout.php file which works fantastically, the issue I am faced
Kinda stuck here... I have an application with lets say 5000 rows of data
Got stuck here: http://jsfiddle.net/UFkg8/ Right now the animation is top-down. What do I need
I have an issue with my ExternalInterface. The way it is currently set up
I have a rather annoying cosmetic issue with jQuery. I'm using the $(window).scroll event

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.