3.2.0

textarea and password type?

I'm building a mockup of our current web-application using the demo to convince the higher ups that "Hey, we don't have to love in the stone age of 1999!". The form I'm designing needs textareas and password types. How would I accomplish this?

Also, has anyone integrated an active widget textarea with FCKEditor?
Eric
February 26,
There are no special controls for textarea and password, but you can create the standard HTML elements using AW code -

var textarea = new AW.HTML.TEXTAREA;
    document.write(textarea);

    var password = new AW.HTML.INPUT;
    password.setAttribute("type", "password");
    document.write(password);
Alex (ActiveWidgets)
February 27,
Is there a way I can derive a custom element to do this? The set of standard HTML controls doesn't match the style. I set the same size on an AW.UI.Input item as an AW.HTML.INPUT item and the sizes are rendered completely different, presumably because of the styles.

Really adding two small methods to AW.UI.Input (or one with an enum) would seem the best option. I know you are against adding stuff, but MultiLine text areas and Password types are integral UI elements in ANY framework :)

var pwbox = new AW.UI.Input;
pwbox.setType(AW.UI.Input.PasswordType);
document.write(pwbox);

var txbox = new AW.UI.Input;
txbox.setType(AW.UI.Input.MultilineType);
document.write(txbox);


Is inheritance possible to override the writing of the <input> portion?
Eric
March 1,
Here is a possible solution for your password needs:

AW.UI.PasswordInput = AW.UI.Input.subclass();
AW.UI.PasswordInput.create = function()
{
  var obj = this.prototype;
  obj.getContent("box/text").setAttribute("type", "password");
}

var pwInput = new AW.UI.PasswordInput;
Jim Hunter (www.FriendsOfAW.com)
March 1,
Excellent. That works perfect, Jim. I'm guessing the same cannot be done for textarea?
Eric
March 1,
I tried quickly on the textarea but didn't try very hard. If I come up with something I'll post it.
Jim Hunter (www.FriendsOfAW.com)
March 2,
Eric,

Try this for your TEXTAREA, you should get a textarea styled just like your input controls:

AW.UI.TextAreaInput = AW.System.Control.subclass();
AW.UI.TextAreaInput.create = function()
{
  var obj = this.prototype;
  obj.setTag("textarea");
  obj.setClass("text", "expand");
  obj.setClass("item", "control");
  obj.setClass("ui", "imagetext");
  obj.setClass("templates", "");
  obj.setClass("input", "box");
}

a = new AW.UI.TextAreaInput;
a.setSize(100,100);
a.setPosition(10,10);
document.write(a);
Jim Hunter (www.FriendsOfAW.com)
March 2,
In the examples provided for the text area control, how can we set the text of the control at runtime? I thought something like:

<script>
textarea.setControlText("hi");
</script>

what can we do?

Thanks
DJ AM Juicebox
March 16,
For the textarea example above you would use:

<script>
a.setContent("hi");
</script>
August 17,
how can GET textarea Conten ?
Valeri
August 24,
obj.element().value;
August 26,

This topic is archived.

See also:


Back to support forum