Hello all
I have a form which displays a decimal field. However when certain conditions are met, I need to change its type to Text, so the user can enter any alphanumeric character.
How do I achieve that with Javascript code? Is it even possible?
Views
Replies
Total Likes
You will not be able to change the field type dynamically. You will have to set the field type as text and then use javascript to restrict the input to the field.
Paul
Views
Replies
Total Likes
If you place a Text field and a Decimal Field in the same location, set the Text field's presence to Hidden and then add script to switch it to Visible while switching the Presence for the Decimal field to Hidden that might mimic what you're looking for.
Views
Replies
Total Likes
Actually, you can dynamically change a textfield.type. AS2.0
You need two elements.
txt.type = "input";
txt.selectable = true;
However, if you have the textfield in a btn you will need to
delete the onRelease function before you can make the tf function correctly.
btn.onRelease = function()
{
delete this.onRelease;
this.txt.type = "input";
this.txt.selectable = true;
}
Views
Replies
Total Likes
Views
Likes
Replies