Skip to main content


 

Symptoms

 


Password control
 

 

Diagnoses

 


How do I set the textbox option to mask the text to appear masked, just like when typing a password? 


 

 

Resolution

The solution to this issue is to insert a data label into the view. In the 'Text' portion of the properties insert the script pasted below.

<script> $('input$name="Text Box"]').get(0).type = 'password' </script>

"Text Box" should equated to the name of the text box is intended to be masked.

 

 



 

Tried the above, but the script itself appears in the Password box (as well as randomly elsewhere on the form).  It's not executing.

 

Is there  a setting someplace to read/run Scripts on this control?

 

Thanks!


Hi, when you drop the datafield on your view/form make sure you check the "Literal" checkbox in the properties of the datalabel. This should solve your issue.


It solved my issue.


Great solution, appreciate the help


Great Article.


@K2Support wrote:

Symptoms


Password control

Diagnoses


How do I set the textbox option to mask the text to appear masked, just like when typing a password? 



Resolution

The solution to this issue is to insert a data label into the view. In the 'Text' portion of the properties insert the script pasted below.

<script> $('inputuname="Text Box"]').get(0).type = 'password' </script>

"Text Box" should equated to the name of the text box is intended to be maske


 


Thanks mate. This worked for me. Awesome job.

I've tweaked it slightly by running it when the document has loaded. If the script runs too soon, it will do nothing.


I've split the script out over multiple lines for readability, but you'd want it on one line.

<script>
    $(document).ready(function()  {
        $('input[name="Text Box"]').get(0).type='password';
    });
</script>

Reply