Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #5397 (closed enhancement: untested)

Opened 2 years ago

Last modified 2 years ago

[PATCH] add maxLength to AJAX inline edit.

Reported by: norm@newcitymedia.com Assigned to: thomas@fesch.at
Priority: normal Milestone:
Component: script.aculo.us Version:
Severity: normal Keywords: InPlaceEditor
Cc:

Description

Awesome work on this libs!!!!

Ran into an issue where I needed a maxLength on a one line input box when editing inline. This allows size to do what it really should do, the size of the box and added another option maxLength. Defaults to 255 if nothing is set. This might want to be adjusted as seen to a best fit.

   if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) {
      this.options.textarea = false;
      var textField = document.createElement("input");
      textField.obj = this;
      textField.type = "text";
      textField.name = "value";
      textField.value = text;
      // Allow a maxLength To be set
      var maxL = this.options.maxLength  || 255 || 0;
      if(maxL != 0) textField.maxLength = maxL ;

-Norm

Change History

08/29/06 17:59:14 changed by madrobby

  • keywords set to InPlaceEditor.

09/04/06 21:53:10 changed by madrobby

  • status changed from new to closed.
  • resolution set to untested.