textarea

How to detect a change with jQuery to the contents of a textarea that's using jWYSIWYG plugin?

放肆的年华 提交于 2019-12-06 06:10:33
I'm using the jwysiwyg plugin on textareas in my form (jwysiwyg: https://github.com/akzhan/jwysiwyg ) I want to detect changes to any of the textareas that are in my form. Normally, with a standard non-wysiwyg textarea, I do: $('textarea').change(function(e){ alert('Something changed!'); }); This proves ineffective when jwysiwyg is being used due to jwysiwyg's DOM manipulation. Anyone have any pointers? Ricardo Castañeda Use this code, I've tested it with the help/example/01.basic.html and 02.full.html, I guess it will work with the others too: $(document).ready(function(){ var current = $("

Twitter-like Textbox Character Count with inline alert

若如初见. 提交于 2019-12-06 05:54:04
问题 I would like to have a textbox character "count up" that will increase the count as a user types and display a text alert when the user crosses the required character but still allows user to continue typing. 回答1: If you want to roll your own HTML <div> Type text here: <input type="text" id="txt" /> </div> <div id="warning" style="color: red; display: none"> Sorry, too much text. </div> <br> <input type="text" id="counter" disabled="disabled" value="0"/> Script $("#txt").keyup(function () {

Text-area with em not working in IE and Opera

若如初见. 提交于 2019-12-06 05:22:06
This is my first attempt to make a complete webpage layout in 'em' measurements. I am building a live preview markdown editor. This page works perfectly in Firefox and chrome, but in IE(i have IE9) and Opera(updated last night) The text-area shoots the boundary significantly. In Opera, the border of textarea is also not showing rounded corners. ( text area is showing rounded corner but not its border) This is css for the textarea #pad { background-color:#BBBB99; background-image:url("../img/edit.png"); border-color:rgba(32, 32, 52, 0.39); border-radius:1em 1em 1em 1em; font-size:1.3em; height

How can I show following text in html textarea?

有些话、适合烂在心里 提交于 2019-12-06 05:14:57
问题 I have a String like the following. Please take a look: I put it as a image, this is not displaying in here too. If I put that String here it becomes the following: 21154537878887GHE\u0044\u0045 Now my question: is there any way to put the original String into an HTML <textarea> without changing the encoding? 回答1: I think you must define your char set in the head. <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>untitled</title> <meta name=

Textarea lags after registering `keydown` events using Javascript

可紊 提交于 2019-12-06 03:49:47
问题 How does one go about attaching a bunch of code to an onkeydown event, but keep entering text into a textarea fast and crisp? Anything more than a couple of IF statements seems to slow it down quite considerably. EDIT : I should add (can't believe I forgot!) that this doesn't affect desktop browsers. It's mainly an issue with iPhone Safari. Other mobile browsers might be affected as well, but we're focusing on iPhone Safari since it executes JS the best (AFAIK) 回答1: Considering your edit

Getting HTML textarea controls to expand to width of container

本小妞迷上赌 提交于 2019-12-06 03:37:33
问题 I want my textarea controls to follow standard block display layout behavior, so that they expand to the width of the containing parent. Simply setting display:block; won't do this- they default to some default with value. Setting width:100%; doesn't work because any padding in the controls means they spill over the container bounds. HTML: <div class='container'> <div >test</div> </div> <div class='container'> <textarea >test</textarea> </div>​ CSS: .container { width:300px; border:black

在JSP里使用CKEditor4.4和CKFinder2.4

旧街凉风 提交于 2019-12-06 02:14:56
最近在做一个新闻发布平台,放弃了很早的FCKEditor,使用CKEditor和CKFinder,尽管免费的CKFinder是Demo版本,但是功能完整,而且用户都是比较集中精神发新闻的人,不会在意这个。按照官网的document一步一步配置,虽然并不难,但是有些东西特别分散,还是全英文的,所以我就整理了一下安装过程和配置,以及需要注意的一些问题。希望对大家有所帮助。 1. 下载CKEditor相关的安装文件 CKEditor: 在 http://ckeditor.com/download 页面左侧,可以下载到各种版本的CKEditor,包括完整版full、标准版standard、基础版basic等。在页面右侧上方,还有可定制的下载,可以选择Toolbar类型、插件、语言等。这里我们选择4.1版本的Full版本,下载后得到CKEditor_4.1_full.zip 。 CKEditor for java: 在 http://ckeditor.com/download 页面右侧下部,可以下载到用于服务器端的工具,记得选择for java版本。这里选择3.6.4版本。但是下载下来却是 ckeditor-java-core-3.5.3.jar。不知道为什么。 CKFinder: 在 http://cksource.com/ckfinder/trial 页面

Flex: How to call an actionscript function from htmlText anchor

烂漫一生 提交于 2019-12-05 19:50:33
Is there any way to call an action script function from an anchor which defined in TextArea component's htmlText property. Thank you If this anchor is an href from an tag, you can dispatch events and handle them like that: <mx:Script> <![CDATA[ private function linkHandler(e:TextEvent):void { if (e.text == "test") trace("test called") } ]]> </mx:Script> <mx:creationComplete> <![CDATA[ textArea.htmlText="<a href='event:test'>Link!</a>"; ]]> </mx:creationComplete> <mx:TextArea id="textArea" link="linkHandler(event)" /> i got the answer here .. The ExternalInterface class will provide you with a

Preserving Tabs in POST Data

旧城冷巷雨未停 提交于 2019-12-05 18:57:06
I need to preserve tab characters from a textarea through POST Data. It seems that there's no way to differentiate tabs from spaces in the $_POST array, and this is really frustrating me. I'm using a jQuery plugin from here to allow for tab and shift+tab usage within a textarea. http://teddevito.com/demos/textarea.html The jQuery plugin is using this as its Tab character: $.fn.tabby.defaults = {tabString : String.fromCharCode(9)}; For some reason, it shows an individual space instead of each tab character, so all my code formatting is lost: <textarea name="field0" rows="26" cols="123"><?php

jQuery .html() does not copy contents of textareas or inputs

我的梦境 提交于 2019-12-05 16:30:16
I'm trying to copy the contents of an element using elem.html() but it's not including the contents of inputs or textareas . Here's an example (try writting in the boxes then click "Copy"): http://jsfiddle.net/gAMmr/2/ Is there a way of copying all info? These are the approaches I have tried so far: elem.clone() - not suitable for my task because it copies the element itself elem.children().clone() - misses out text nodes elem.contents().clone() - doesn't include the textarea contents EDIT: The results seem to be different in each browser. I'm using Chrome. $("button").click(function () { $("