Change a fields' display type at runtime

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

Change a fields' display type at runtime

#1

Postby Segi » Fri Apr 10, 2015 4:20 pm

I have a field called PASSWORD that has Password as the display type so that the contents are masked with an asterisk.

I want to trigger an event when the user clicks on a button next to this field that will change the display type back to text to make it readable

I tried doing something like this but setDisplayType is not a valid function
field.

Code: Select all

fields.PASSWORD.fieldControl.field.setDisplayType("TEXT");
Can this be done ?
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Mon Apr 13, 2015 7:22 am

Hi Segi,

What you are trying to do is not supported.

The best way to get round this is to have 2 fields on the page. One field as a password field and one normal field. Put this in to a panel and show/hide the appropriate field when the button is clicked.

Of course the downside to this is that you need to maintain the value in two fields.

Steve
0 x


Who is online

Users browsing this forum: No registered users and 21 guests