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.
Results 1 to 5 of 5
  1. #1
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,924
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts

    Something wrong with copy from text in code tags.

    Something seems to have gone wrong with the site.


    When I copy code within code tags, for example at
    Validate Date field MM/DD/YYYY with legit date
    I get

    <script type = "text/javascript"> String.prototype.isValidDate = function(){ var arrParts = this.split("/"); var date1 = new Date(this.toString()); dtReturn = (date1.getMonth()+1 == parseInt(arrParts[0],10) && date1.getDate() == parseInt(arrParts[1],10) && date1.getFullYear() == parseInt(arrParts[2],10) ); return dtReturn; // true or false } var strDate1 = "01/31/2012"; // USA date format var strDate2 = "2/31/2012"; alert(strDate1 + ": " + strDate1.isValidDate()); alert(strDate2 + ": " + strDate2.isValidDate()); </script>
    Read more at Validate Date field MM/DD/YYYY with legit date

    Note that the newlines are lost and a message about "read more" is appended.

    Is this something to do with Facebook/Twitter? It is an annoying glitch!

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Any follow up on this? Or is it a new feature ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    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
    I noticed this too; started up about a week ago. I copy from mainly PHP tags and I don't believe I loose the linefeeds, I'll have to try on code ones too.
    Its a little annoying I have to admit yeah. I would suggest that the way to fix it is to either remove it completely or make it so the paste doesn't apply that line if pasted back into codingforums.com. I'm not sure where it comes from, so masmedia is looking into any of the new functionality added to see if it could include that.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,924
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    It is the loss of the line breaks which is the biggest annoyance. That will cause significant problems for newcomers who are trying to copy and paste code into their own pages. Not user-friendly!

    As you say, it dos not happen with php tags, so why does it happen with Javascript code tags? It must be a coding error. Please fix it soon - whoever did it managed to introduce this glitch into the forum up within hours, so why can he not put it right in hours?
    Last edited by Philip M; 11-14-2012 at 08:45 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,924
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    It looks as though this problem has now been resolved!

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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