can you give me a hint… i have input text for some users comments, and there is a limit of symbols (100)… i want to count how much symbols left to write and write number in dynamic text box
I guess he meant something like this
var max_chars = 100;
createTextField("inputField", 1, 0, 0, 200, 20);
createTextField("counterField", 2, 210, 0, 50, 20);
inputField.type = "input";
inputField.border = counterField.border=true;
inputField.maxChars = 100;
inputField.onChanged = updateField;
function updateField() {
counterField.text = max_chars-inputField.text.length;
}
updateField();
rhamej
April 26, 2006, 3:56am
4
claudio:
I guess he meant something like this ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]var [/COLOR] max_chars = [COLOR=#000080]100[/COLOR];
[COLOR=#0000ff]createTextField[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“inputField”[/COLOR], [COLOR=#000080]1[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]200[/COLOR], [COLOR=#000080]20[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000ff]createTextField[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“counterField”[/COLOR], [COLOR=#000080]2[/COLOR], [COLOR=#000080]210[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]50[/COLOR], [COLOR=#000080]20[/COLOR][COLOR=#000000])[/COLOR];
inputField.[COLOR=#0000ff]type[/COLOR] = [COLOR=#ff0000]“input”[/COLOR];
inputField.[COLOR=#0000ff]border[/COLOR] = counterField.[COLOR=#0000ff]border[/COLOR]=[COLOR=#000000]true [/COLOR];
inputField.[COLOR=#0000ff]maxChars[/COLOR] = [COLOR=#000080]100[/COLOR];
inputField.[COLOR=#0000ff]onChanged[/COLOR] = updateField;
[COLOR=#000000]function [/COLOR] updateFieldCOLOR=#000000 [/COLOR] [COLOR=#000000]{[/COLOR]
counterField.[COLOR=#0000ff]text[/COLOR] = max_chars-inputField.[COLOR=#0000ff]text[/COLOR].[COLOR=#0000ff]length[/COLOR];
[COLOR=#000000]}[/COLOR]
updateFieldCOLOR=#000000 [/COLOR];
[/LEFT]
[/FONT]
ahhh, my bad. I missed the input field part. All I saw was symbols