Monkuar Posted December 16, 2011 Share Posted December 16, 2011 var str = document.REPLIER.Post.value='{$ibforums->input['Post']}'; document.REPLIER.Post.value = str.replace(/<br\s*[\/]?>/gi, "\\n"); Okay this above code works very nice, it replaces all the <br>'s with \\n so when people press "enter" it doesn't show the whole form with <Br>'s But I want to make it so so if somone enter's a ' OR " OR any other html char, that is converts it back to the same the thing I entered.. instead of "#&39;" or whatever... Example: If I click on Preview Post, it passes through server side ofc to check my bbcode parser, but then it spits the "#&39;" back at me in my editing field which is my code I showed you above! I already converted it so it show's \n instead of <br>'s so it's nice. but now I want to convert the #&39; back to " ' " or any other entity back to it's original character EDIT(Yes I do check my inputs server side, for html tags/etc, but since the editor is client side it converts them back to the #&39; stuff which I need to be converted back to the original state of the character. Please help, (Hell even if jquery can do this I am down).. Quote Link to comment https://forums.phpfreaks.com/topic/253272-need-to-replace-and-and-all-html-entities-i-cant/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.