Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/02/2010, 16:46
rrecarte
 
Fecha de Ingreso: agosto-2008
Mensajes: 367
Antigüedad: 16 años, 3 meses
Puntos: 5
limitar textarea

buenas... mi consulta es como limito el maximo que puedan escribir de largo en un text area que es un editor de texto de javasctipt.. es extremadamente largo el codigo para pegarlo

no quiero limitar el largo que se ve.... whidth.
lo que quiero limitar es el largo maximo que puedan escribir antes de pasar al proximo renglon...

como lo hago... es desde vacascript o desde el textarea.. paso a pegar el codigo cortado para ver quien me pueda ayudar. gracias

var WYSIWYG = {

/**
* Settings class, holds all customizeable properties
*/
Settings: function() {

// Images Directory
this.ImagesDir = "images/";

// Popups Directory
this.PopupsDir = "popups/";

// CSS Directory File
this.CSSFile = "styles/wysiwyg.css";

// Default WYSIWYG width and height (use px or %)
this.Width = "500px";
this.Height = "200px";

// Default stylesheet of the WYSIWYG editor window
this.DefaultStyle = "font-family: Arial; font-size: 12px; background-color: #FFFFFF";

// Stylesheet if editor is disabled
this.DisabledStyle = "font-family: Arial; font-size: 12px; background-color: #EEEEEE";

// Width + Height of the preview window
this.PreviewWidth = 500;
this.PreviewHeight = 400;

// Confirmation message if you strip any HTML added by word
this.RemoveFormatConfMessage = "Clean HTML inserted by MS Word ?";

// Nofication if browser is not supported by openWYSIWYG, leave it blank for no message output.
this.NoValidBrowserMessage = "openWYSIWYG does not support your browser.";

// Anchor path to strip, leave it blank to ignore
// or define auto to strip the path where the editor is placed
// (only IE)
this.AnchorPathToStrip = "auto";

// Image path to strip, leave it blank to ignore
// or define auto to strip the path where the editor is placed
// (only IE)
this.ImagePathToStrip = "auto";

// Enable / Disable the custom context menu
this.ContextMenu = true;

// Enabled the status bar update. Within the status bar
// node tree of the actually selected element will build
this.StatusBarEnabled = true;

// If enabled than the capability of the IE inserting line breaks will be inverted.
// Normal: ENTER = <p> , SHIFT + ENTER = <br>
// Inverted: ENTER = <br>, SHIFT + ENTER = <p>
this.InvertIELineBreaks = false;

// Replace line breaks with <br> tags
this.ReplaceLineBreaks = false;

// Page that opened the WYSIWYG (Used for the return command)
this.Opener = "admin.asp";

// Insert image implementation
this.ImagePopupFile = "";
this.ImagePopupWidth = 0;
this.ImagePopupHeight = 0;

// Holds the available buttons displayed
// on the toolbar of the editor
this.Toolbar = new Array();
this.Toolbar[0] = new Array(
"font",
"fontsize",
"headings",
"bold",
"italic",
"underline",
"strikethrough",
"seperator",
"forecolor",
"backcolor",
"seperator",
"justifyfull",
"justifyleft",
"justifycenter",
"justifyright",
"seperator",
"unorderedlist",
"orderedlist",
"outdent",
"indent"
);
this.Toolbar[1] = new Array(
"save",
// "return", // return button disabled by default
"seperator",
"subscript",
"superscript",
"seperator",
"cut",
"copy",
"paste",
"removeformat",
"seperator",
"undo",
"redo",
"seperator",
"inserttable",
"insertimage",
"createlink",
"seperator",
"preview",
"print",
"seperator",
"viewSource",
"maximize",
"seperator",
"help"
);

// DropDowns
this.DropDowns = new Array();
// Fonts
this.DropDowns['font'] = {
id: "fonts",
command: "FontName",
label: "<font style=\"font-family:{value};font-size:12px;\">{value}</font>",
width: "90px",
elements: new Array(
"Arial",
"Sans Serif",
"Tahoma",
"Verdana",
"Courier New",
"Georgia",
"Times New Roman",
"Impact",
"Comic Sans MS"
)
};
// Font sizes
this.DropDowns['fontsize'] = {
id: "fontsizes",
command: "FontSize",
label: "<font size=\"{value}\">Size {value}</font>",
width: "54px",
elements: new Array(
"1",
"2",
"3",
"4",
"5",
"6",
"7"
)
};
// Headings
this.DropDowns['headings'] = {
id: "headings",
command: "FormatBlock",
label: "<{value} style=\"margin:0px;text-decoration:none;font-family:Arial\">{value}</{value}>",
width: "74px",
elements: new Array(
"H1",
"H2",
"H3",
"H4",
"H5",
"H6"
)
};

// Add the given element to the defined toolbar
// on the defined position
this.addToolbarElement = function(element, toolbar, position) {
if(element != "seperator") {this.removeToolbarElement(element);}
if(this.Toolbar[toolbar-1] == null) {
this.Toolbar[toolbar-1] = new Array();
}
this.Toolbar[toolbar-1].splice(position+1, 1, element);
};

// Remove an element from the toolbar
this.removeToolbarElement = function(element) {
if(element == "seperator") {return;} // do not remove seperators
for(var i=0;i<this.Toolbar.length;i++) {
if(this.Toolbar[i]) {
var toolbar = this.Toolbar[i];
for(var j=0;j<toolbar.length;j++) {
if(toolbar[j] != null && toolbar[j] == element) {
this.Toolbar[i].splice(j,1);
}
}
}
}
};

// clear all or a given toolbar
this.clearToolbar = function(toolbar) {
if(typeof toolbar == "undefined") {
this.Toolbar = new Array();
}
else {
this.Toolbar[toolbar+1] = new Array();
}
};

},
},