Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    I think we may need more than one
    look at the previous posts, there's everything you want to know..

  2. #17
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,281
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    Quote Originally Posted by Trisy123 View Post
    look at the previous posts, there's everything you want to know..
    Not really. I see one screenshot (which was approved after I made that last reply btw) and now also a link to the page itself.

    Quote Originally Posted by Trisy123 View Post
    As I noticed, it seems to be a JS problem indeed..
    When you click on a post, everything at the right will change to the right settings and add the existing post. But it seems that this line break is breaking that function. I'm not soo good at explaining, but with this screencap it must be pretty clear.
    You can say that again You must however get better and try harder instead of leaving others to guess - You want the help so try to put in some effort Don't just give us a bad description and assume we'll fix it for you - thats not fair.

    The only thing I can see is this thing doesn't seem to work reliably:


    Anyway despite not being a javascript / html expert, I know some basics and looking at your code I noticed this:


    You can't have a broken string like that in javascript that is placed over multiple lines - it breaks the javascript. Instead in Javascript you must use \n instead to represent a new line.

    In your php this line:
    document.getElementById( 'text_post' ).value = '$text';

    Try this instead:
    $text = str_replace("\r\n", '\n', $text);
    document.getElementById( 'text_post' ).value = '$text';

    No promises that will work as unix uses \n only and windows uses \r\n so you might want two str_replace lines.
    Last edited by tangoforce; 06-20-2013 at 11:27 AM.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  3. #18
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    So. . . javascript.
    Moving from PHP forum to Javascript forum.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  4. #19
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts
    The <option> tag does not have an onchange event. Apply your onchange to the <select> tag only.

    Before going further, perhaps you'd care to fix these indicated errors:
    SyntaxError: unterminated string literal
    [Break On This Error]

    document.getElementById( 'text_post' ).value = 'This post has an enter key

    test.php (line 97, col 51)

    SyntaxError: unterminated string literal
    [Break On This Error]

    document.getElementById( 'text_post' ).value = 'g

    test.php (line 123, col 51)

    SyntaxError: unterminated string literal
    [Break On This Error]

    document.getElementById( 'text_post' ).value = '

    test.php (line 171, col 51)


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •