Jump to content

Textfield on Newsletter Mailer stops after 3-5 characters


Mutley

Recommended Posts

Hi there,

 

Having a problem with the following script. I believe it may be to do with either the Fckeditor or Javascript.

 

After so many characters (when I start a new paragraph I think), it cuts off, so the e-mail could just send as "Hi," with no message underneath it.

 

Any ideas how to fix this? It works with a textarea instead of Fckeditor but then there is no formatting... I'm guessing it's specifically the line:

var emailbody = FCKeditorAPI.GetInstance('email-body').GetHTML();

 

<?php include_once("fckeditor/fckeditor.php");?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Mailer</title>
        <link type="text/css" rel="stylesheet" href="css/main.css" />
        <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#send-email').click(function() {
                    $('#hide-progress-window').click(function() {
                        $('#sending-progress-window').hide();
                        $('#hide-progress-window').hide();
                    });
                    var emailsubject = $('#email-subject').val();
                    var emailbody = FCKeditorAPI.GetInstance('email-body').GetHTML();
                    var singleemail = $('#single-email').val();
                    if (singleemail != "") {
                        $('#sending-progress-window').fadeIn('slow');
                        $('#sender-response').html('Sending to <strong style="color:#3399ff;">'+ singleemail +'</strong>');
                                $.post("send.php?action=singlesend", {singleemailval:singleemail, emailsubjectval:emailsubject, emailbodyval:emailbody },
                                    function(){
                                        $('#sending-progress-window').fadeIn('slow');
                                        $('#img-ajax-loader').attr('src', 'images/ok.png');
                                        $('#sender-response').html('Email sent!');
                                        $('#hide-progress-window').fadeIn('slow');
                                });
                    }
                    else if (confirm("Email all users now?")){
                        $('#sending-progress-window').fadeIn('slow');
                        $.get("send.php", { action: "parts" },
                        function(data){
                            total_parts = data;
                            for(i=1;i<=total_parts;i++) {
                               $.ajax({
                                    type: "POST",
                                    url: "send.php?action=send&part="+i,
                                    data: "emailsubjectval="+emailsubject+"&emailbodyval="+emailbody,
                                    async: false,
                                    success: function(){
                                      if (i==total_parts){
                                        $('#img-ajax-loader').attr('src', 'images/ok.png');
                                        $('#sender-response').html('Sended <strong style="color:#3399ff;">'+ i +'</strong> of <strong style="color:#3399ff;">'+ total_parts +'</strong> parts');
                                        $('#hide-progress-window').fadeIn('slow');
                                      }
                                      $('#sender-response').html('Sended <strong style="color:#3399ff;">'+ i +'</strong> of <strong style="color:#3399ff;">'+ total_parts +'</strong> parts');
                                    }
                                });
                            }
                        });
                    }
                });
            });
        </script>
    </head>
    <body>
        <div class="header">
            <ul class="top-menu">
                <li>
                    <img src="images/email.png" /><a class="active">LEFT's Mail System</a>
                </li>
            </ul>
        </div>
        <div class="main-body">
        
        <label for="email-subject">subject: </label><input type="text" id="email-subject" name="email-subject" class="subject" />
        <script type="text/javascript">
            var oFCKeditor = new FCKeditor('email-body');
            oFCKeditor.BasePath = "fckeditor/";
            oFCKeditor.Height = '500';
            oFCKeditor.Create();
        </script>

            <div style="text-align:right;">
                <label for="single-email">send to a single address: </label><input type="text" name="single-email" id="single-email" size="45" />
                <input type="button" value="Send" id="send-email">
            </div>
        <div id="sending-progress-window">
            <img src="images/ajax-loader.gif" alt="" id="img-ajax-loader" />
            <p id="sender-response">Connecting...</p>
        </div>
        <p id="hide-progress-window">Close this message</p>
        </div>
    </body>
</html>

 

Thanks in advance,

Nick.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.