[GH-ISSUE #41] jQuery error, when trying to add new mailbox #36

Closed
opened 2026-02-26 09:35:19 +03:00 by kerem · 4 comments
Owner

Originally created by @pietervogelaar on GitHub (Jun 3, 2013).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/41

SyntaxError: unterminated string literal
[Afbreken op deze fout]

var data = $('#moda

100-jquery.js (line 619, col 25)

Originally created by @pietervogelaar on GitHub (Jun 3, 2013). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/41 SyntaxError: unterminated string literal [Afbreken op deze fout] var data = $('#moda 100-jquery.js (line 619, col 25)
kerem closed this issue 2026-02-26 09:35:20 +03:00
Author
Owner

@pietervogelaar commented on GitHub (Jun 3, 2013):

On this URL https://vogelaarsolutions.nl/vimbadmin/mailbox/edit/modal/1/did/11, I get the following code.
The content is cut off at the bottom, so obviously javascript gives an error.

But why is this? I worked for a week fine, but suddenly this occurred.

<div class="modal-header">
        <a href="#" class="close" data-dismiss="modal">&times;</a>
            <h3>Add Mailbox</h3>
    </div>
    <div class="modal-body" style="min-height: 200px;">


<div id="form_div_edit_mailbox">

    <form action=""
          method="post"
          enctype=""
          id="mailbox_edit_form"
          name="mailbox_edit_form"
                    class="form-horizontal">

          <fieldset class="control-group" id="div-form-address">
            <label for="local_part" class="control-label">
                    Address
            </label>
            <div id="div-controls-local_part" class="controls">
                <div class="input-append" style="float: left;">

<input type="text" name="local_part" id="local_part" value="" size="40" title="Local Part" class="required span2" />
                                            <span class="add-on" style="margin-left: -5px;">@example.com</span>
                        <div style="display: none;">
<select name="domain" id="domain" title="Domain" class="required add-on-input">
    <option value="" label="- select -">- select -</option>
</select></div>
                                    </div>

                                <p id="help-local_part" class="help-block">
                                    </p>
                                <p id="help-domain" class="help-block">
                                    </p>
            </div>
        </fieldset>

                <fieldset class="control-group" id="div-form-name">
            <label for="name" class="control-label ">
                                    Name
                            </label>
            <div id="div-controls-name" class="controls">

<input type="text" name="name" id="name" value="" size="40" title="Name" />

                                <p id="help-name" class="help-block">
                                    </p>
            </div>
        </fieldset>


                    <fieldset class="control-group" id="div-form-password">
            <label for="passowrd" class="control-label">
                    Password
            </label>
            <div id="div-controls-password" class="controls">
                <div class="input-append">

<input type="text" name="password" id="password" value="" title="Password" size="40" />
                                            <span id="password_rand" onclick="randPasword( 12, 'password' );" title="Random Password" class="btn add-on" style="margin-left: -5px;">
                            <i class="icon-refresh"></i>
                        </span>
                                    </div>

                                    <p id="help-password" class="help-block">
                                        </p>

            </div>
        </fieldset>

                <fieldset class="control-group" id="div-form-quota">
            <label for="quota" class="control-label ">
                                    Quota
                            </label>
            <div id="div-controls-quota" class="controls">

<input type="text" name="quota" id="quota" value="0" title="Quota" size="5" />

                                <p id="help-quota" class="help-block">
                                    </p>
            </div>
        </fieldset>

                <fieldset id="div-form-active" class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <label class="checkbox">
                    <input id="active" type="checkbox"
                        checked="checked"                       value="1" name="active"
                    />
                    Active&nbsp;                                    </label>
                                <span class="help-block">
                                    </span>
            </div>
        </fieldset>


                            <fieldset id="div-form-welcome_email" class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <label class="checkbox">
                    <input id="welcome_email" type="checkbox"
                                                value="1" name="welcome_email"
                    />
                    Welcome email&nbsp;                                 </label>
                                <span class="help-block">
                                    </span>
            </div>
        </fieldset>

            <div id="div_welcome_email" class="dontdisplay">
                        <fieldset class="control-group" id="div-form-cc_welcome_email">
            <label for="cc_welcome_email" class="control-label ">
                                    CC welcome email
                            </label>
            <div id="div-controls-cc_welcome_email" class="controls">

<input type="text" name="cc_welcome_email" id="cc_welcome_email" value="" size="40" title="CC welcome email" />

                                <p id="help-cc_welcome_email" class="help-block">
                                    </p>
            </div>
        </fieldset>

            </div>

            </form>

    <script type="text/javascript">

        $(document).ready(function()
        {
                        $( '#domain' ).chosen();

            if( $( "#access_restr" ).attr( "checked" ) == "checked" )
            {
                $( "#access_restriction_div" ).show();
                $( "#allow_to").show();
            }

            if( $( '#domain_chzn' ).css( "width" ).length < 5 )
            {
                $( '#domain_chzn' ).css( "width", "150px" );
                $( '#domain_chzn > .chzn-drop' ).css( "width", "148px" );
                $( '#domain_chzn > .chzn-drop .chzn-search > input' ).css( "width", "110px" );
            }

            $('#welcome_email').bind( 'change', function() {
                $('#div_welcome_email').toggle('slow');
            });

            $( "#access_restr" ).change( function(){
                $( "#access_restriction_div" ).toggle( "slow" );
                $( "#allow_to").toggle( "fast" );
            });
        }); // document onready

    </script>
</div> <!-- #form_div_edit_mailbox -->


<script type="text/javascript"> /* <![CDATA[ */

    $(document).ready(function() {
        $('#mailbox_edit_form').validate({
            rules: {
                'local_part': { required: true, notEmpty: true, minlength: 1, maxlength: 255 },
                'domain': { required: true, notEmpty: true, minlength: 1, maxlength: 255, inArray: [ 4, 5, 6, 7, 15, 8, 9, 2, 3, 10, 11, 12, 1, 13 ] },
                'name': { minlength: 0, maxlength: 255 },
                'password': { required: true, notEmpty: true, minlength: 8, maxlength: 32 },
                'active': { inArray: [ 0, 1 ] },
                'welcome_email': { inArray: [ 0, 1 ] },
                'cc_welcome_email': { email: true }
            },
          errorElement: 'span',
        errorPlacement: function (error, element) {
                                error.appendTo( '#help-' + element.attr('id') );
                             }
        });
    });

/* ]]> */ </script>



    </div>
    <div class="modal-footer" id="mtfooter">
        <button id="modal_dialog_save" class="btn btn-primary">Add</button>
        <button id="modal_dialog_cancel" class="btn">Cancel</button>
        <script type="text/javascript">
    $(document).ready(function()
    {
        $('#modal_dialog_save').bind('click', function() {
            valid = true;
            var data = $('#moda
<!-- gh-comment-id:18856310 --> @pietervogelaar commented on GitHub (Jun 3, 2013): On this URL https://vogelaarsolutions.nl/vimbadmin/mailbox/edit/modal/1/did/11, I get the following code. The content is cut off at the bottom, so obviously javascript gives an error. But why is this? I worked for a week fine, but suddenly this occurred. ``` <div class="modal-header"> <a href="#" class="close" data-dismiss="modal">&times;</a> <h3>Add Mailbox</h3> </div> <div class="modal-body" style="min-height: 200px;"> <div id="form_div_edit_mailbox"> <form action="" method="post" enctype="" id="mailbox_edit_form" name="mailbox_edit_form" class="form-horizontal"> <fieldset class="control-group" id="div-form-address"> <label for="local_part" class="control-label"> Address </label> <div id="div-controls-local_part" class="controls"> <div class="input-append" style="float: left;"> <input type="text" name="local_part" id="local_part" value="" size="40" title="Local Part" class="required span2" /> <span class="add-on" style="margin-left: -5px;">@example.com</span> <div style="display: none;"> <select name="domain" id="domain" title="Domain" class="required add-on-input"> <option value="" label="- select -">- select -</option> </select></div> </div> <p id="help-local_part" class="help-block"> </p> <p id="help-domain" class="help-block"> </p> </div> </fieldset> <fieldset class="control-group" id="div-form-name"> <label for="name" class="control-label "> Name </label> <div id="div-controls-name" class="controls"> <input type="text" name="name" id="name" value="" size="40" title="Name" /> <p id="help-name" class="help-block"> </p> </div> </fieldset> <fieldset class="control-group" id="div-form-password"> <label for="passowrd" class="control-label"> Password </label> <div id="div-controls-password" class="controls"> <div class="input-append"> <input type="text" name="password" id="password" value="" title="Password" size="40" /> <span id="password_rand" onclick="randPasword( 12, 'password' );" title="Random Password" class="btn add-on" style="margin-left: -5px;"> <i class="icon-refresh"></i> </span> </div> <p id="help-password" class="help-block"> </p> </div> </fieldset> <fieldset class="control-group" id="div-form-quota"> <label for="quota" class="control-label "> Quota </label> <div id="div-controls-quota" class="controls"> <input type="text" name="quota" id="quota" value="0" title="Quota" size="5" /> <p id="help-quota" class="help-block"> </p> </div> </fieldset> <fieldset id="div-form-active" class="control-group"> <label class="control-label"></label> <div class="controls"> <label class="checkbox"> <input id="active" type="checkbox" checked="checked" value="1" name="active" /> Active&nbsp; </label> <span class="help-block"> </span> </div> </fieldset> <fieldset id="div-form-welcome_email" class="control-group"> <label class="control-label"></label> <div class="controls"> <label class="checkbox"> <input id="welcome_email" type="checkbox" value="1" name="welcome_email" /> Welcome email&nbsp; </label> <span class="help-block"> </span> </div> </fieldset> <div id="div_welcome_email" class="dontdisplay"> <fieldset class="control-group" id="div-form-cc_welcome_email"> <label for="cc_welcome_email" class="control-label "> CC welcome email </label> <div id="div-controls-cc_welcome_email" class="controls"> <input type="text" name="cc_welcome_email" id="cc_welcome_email" value="" size="40" title="CC welcome email" /> <p id="help-cc_welcome_email" class="help-block"> </p> </div> </fieldset> </div> </form> <script type="text/javascript"> $(document).ready(function() { $( '#domain' ).chosen(); if( $( "#access_restr" ).attr( "checked" ) == "checked" ) { $( "#access_restriction_div" ).show(); $( "#allow_to").show(); } if( $( '#domain_chzn' ).css( "width" ).length < 5 ) { $( '#domain_chzn' ).css( "width", "150px" ); $( '#domain_chzn > .chzn-drop' ).css( "width", "148px" ); $( '#domain_chzn > .chzn-drop .chzn-search > input' ).css( "width", "110px" ); } $('#welcome_email').bind( 'change', function() { $('#div_welcome_email').toggle('slow'); }); $( "#access_restr" ).change( function(){ $( "#access_restriction_div" ).toggle( "slow" ); $( "#allow_to").toggle( "fast" ); }); }); // document onready </script> </div> <!-- #form_div_edit_mailbox --> <script type="text/javascript"> /* <![CDATA[ */ $(document).ready(function() { $('#mailbox_edit_form').validate({ rules: { 'local_part': { required: true, notEmpty: true, minlength: 1, maxlength: 255 }, 'domain': { required: true, notEmpty: true, minlength: 1, maxlength: 255, inArray: [ 4, 5, 6, 7, 15, 8, 9, 2, 3, 10, 11, 12, 1, 13 ] }, 'name': { minlength: 0, maxlength: 255 }, 'password': { required: true, notEmpty: true, minlength: 8, maxlength: 32 }, 'active': { inArray: [ 0, 1 ] }, 'welcome_email': { inArray: [ 0, 1 ] }, 'cc_welcome_email': { email: true } }, errorElement: 'span', errorPlacement: function (error, element) { error.appendTo( '#help-' + element.attr('id') ); } }); }); /* ]]> */ </script> </div> <div class="modal-footer" id="mtfooter"> <button id="modal_dialog_save" class="btn btn-primary">Add</button> <button id="modal_dialog_cancel" class="btn">Cancel</button> <script type="text/javascript"> $(document).ready(function() { $('#modal_dialog_save').bind('click', function() { valid = true; var data = $('#moda ```
Author
Owner

@pietervogelaar commented on GitHub (Jun 3, 2013):

So right now my mail administration is broken :-(

<!-- gh-comment-id:18857267 --> @pietervogelaar commented on GitHub (Jun 3, 2013): So right now my mail administration is broken :-(
Author
Owner

@barryo commented on GitHub (Jun 4, 2013):

So it was working for a week and then "suddenly stopped"?

Doesn't look like a ViMbAdmin issue I'm afraid. There is nothing to cause an error where it has been cut off and my currently version is working fine.

Suggest you evaluated any other changes you made and also check the Apache error logs and ViMbAdmin's own logs for issues (var/logs/...).

<!-- gh-comment-id:18891954 --> @barryo commented on GitHub (Jun 4, 2013): So it was working for a week and then "suddenly stopped"? Doesn't look like a ViMbAdmin issue I'm afraid. There is nothing to cause an error where it has been cut off and my currently version is working fine. Suggest you evaluated any other changes you made and also check the Apache error logs and ViMbAdmin's own logs for issues (`var/logs/...`).
Author
Owner

@pietervogelaar commented on GitHub (Jun 4, 2013):

I debugged the code, and on my local machine it was working correctly indeed. I could not reproduce it.

After two hours I restarted php-fpm and suddenly it worked again :-S Maybe some strange APC problem.

<!-- gh-comment-id:18892498 --> @pietervogelaar commented on GitHub (Jun 4, 2013): I debugged the code, and on my local machine it was working correctly indeed. I could not reproduce it. After two hours I restarted php-fpm and suddenly it worked again :-S Maybe some strange APC problem.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ViMbAdmin-opensolutions#36
No description provided.