LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nxg web module string display as password

Solved!
Go to solution

Hi All, 

 

I want to display string control as password in nxg web vi (currently using version 3.1).

 

I don't see a property to set that. I don't see masked input as well (available in nxg) and I don't know how to add <input> tag with type="password" in nxg web vi. 

 

Is there a method or workaround (e.g. Updating CSS or using javascript) to do that?

 

Thanks

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 1 of 12
(4,456 Views)

Hey! I recently ran into the same problem with a WebVI. Besides Java and/ or CSS is see two other ways to do this.

 

  1. Use a normal String Indicator and the "value changed" event in order to save a new letter and replace it with a * or whatever you like. This way you can also implement some nice features like masking the letter only after x ms or when the next key is pressed or even a seperate button to show the password befor you send it.
  2. You can use a separate dialogue to enter a username/ password with SweetAlerts for LabView. You can find a nicely working library here: https://github.com/rajsite/webvi-experiments (SweetAlert). With the provided Vi's you can easily setup the dialogues and change a simple property if you want to mask the entered password. And they look pretty awesome too 🙂

 

0 Kudos
Message 2 of 12
(4,402 Views)

Thanks Jens.

 

Unfortunately, I don't find Update While Typing property in String Control for NXG web.

 

What we do is modifying the CSS by adding this simple css script to text attribute :  -webkit-text-security: disc;

 

It works in chrome.

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 3 of 12
(4,302 Views)

Hi!

 

can you give me some more information where you change this? I'm pretty new to the whole html/css thing.

0 Kudos
Message 4 of 12
(4,291 Views)

Sorry for late reply. In the end, we used specific font for compatibility with all browsers.

 

In CSS:

            @font-face {
                font-family: "password-mask";
                src: url(data:font/woff;charset:utf-8;base64,d09GRgABAAAAAAusAAsAAAAAMGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZjRmM5Y21hcAAAAYQAAAgCAAArYmjjYVVnbHlmAAAJiAAAAEEAAABQiOYj2mhlYWQAAAnMAAAALgAAADYOxVFUaGhlYQAACfwAAAAcAAAAJAqNAyNob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2IGMIuBgQsIGRj+g/kMAArUATEAAHicjY69TsMwFIWP+4doJYSKhMTmoUJIqOnPWIm1ZWDq0IEtTZw2VRpHjlu1D8A7MPMczAw8DM/AifFEl9qS9d1zzr3XAK7xBYHqCHTdW50aLlj9cZ1057lBfvTcRAdPnlvUnz23mXj13MEN3jhBNC6p9PDuuYYrfHquU//23CD/eG7iVnQ9t9ATD57bWIgXzx3ciw+rDrZfqmhnUnvsx2kZzdVql4Xm1DhVFsqUqc7lKBiemjOVKxNaFcvlUZb71djaRCZGb+VU51ZlmZaF0RsV2WBtbTEZDBKvB5HewkLhwLePkhRhB4OU9ZFKTCqpzems6GQI6Z7TcU5mQceQUmjkkBghwPCszhmd3HWHLh+ze8mEpLvnT8dULRLWCTMaW9LUbanSGa+mUjhv47ZY7l67rgITDHiTf/mAKU76BTuXfk8AAHicY2BigAARBuyAiZGJkZmBJSWzOJmBAQALQwHHAAAA) format("woff");
            }
           
            jqx-multiline-text-box[ni-control-id='680'] {
                font-family: password-mask;
            }

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 5 of 12
(4,011 Views)

I have a source code like this. How can I apply the password display for id='10'?
I am very new with CSS and especially in LabVIEW WebVI

Thank you

Spoiler

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<!---Read only section. Source panel edits to these document properties will not be persisted-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>index</title>
<!---End read only section. Additional scripts or document properties can be added outside this section-->
<style ni-autogenerated-style-id="">
/* Edits to the content of this style tag will not be persisted. To add additional styles, add a new style tag before or after this one */
</style>
<link href="support/style.css" rel="stylesheet">

</head>

<body>
<div id="ni-outdated-browser-message" style="display:none">This browser is reporting compatibility with older browser technologies that may perform poorly if it all.</div>
<div id="ni-failed-to-load-vireo-source" style="display:none">
<div id="ni-failed-to-load-vireo-message-title">
Unable to load resource file
</div>
<div id="ni-failed-to-load-vireo-message-body">
Verify all WebVI files are available and served using an HTTP server or use a browser that can load files directly from the file system. See <a href="http://digital.ni.com/express.nsf/bycode/HOSTWEBAPP">Hosting a Web Application on a Server</a> for more information.
</div>
</div>
<div class="ni-front-panel-wrapper" vi-ref="" ni-control-id="FrontPanelWrapper">
<ni-front-panel control-resize-mode='fixed' layout='absolute' ni-control-id='18'>

<ni-label control-resize-mode='fixed' label-alignment='top-left' ni-control-id='17' text='LED'></ni-label>
<jqx-led binding-info='{"accessMode": "writeOnly", "dataItem": "dataItem_LED", "dco": 2, "isLatched": false, "prop": "value", "sync": false, "unplacedOrDisabled": false}' click-mode='release' control-resize-mode='fixed' false-content='Off' follower-ids='["17"]'
label-alignment='top-left' label-id='17' ni-control-id='16' readonly='true' shape='square' true-content='On'></jqx-led>
<ni-cluster binding-info='{"accessMode": "readOnly", "dataItem": "dataItem_Login", "dco": 0, "isLatched": false, "prop": "value", "sync": false, "unplacedOrDisabled": false}' control-resize-mode='fixed' follower-ids='["5"]' label-alignment='top-left'
label-id='5' layout='absolute' ni-control-id='7' ni-type='{"fields": ["Username", "Password"], "name": "Cluster", "subtype": ["String", "String"]}' value='{"Password": "", "Username": ""}'>
<ni-string-control binding-info='{"field": "Username", "prop": "text", "sync": false}' control-resize-mode='fixed' escaped-display-mode='default' follower-ids='["12"]' label-alignment='top-left' label-id='12' ni-control-id='14' text=''></ni-string-control>
<ni-label control-resize-mode='fixed' label-alignment='top-left' ni-control-id='12' text='Username'></ni-label>
<ni-string-control binding-info='{"field": "Password", "prop": "text", "sync": false}' control-resize-mode='fixed' escaped-display-mode='default' follower-ids='["8"]' label-alignment='top-left' label-id='8' ni-control-id='10' text=''></ni-string-control>
<ni-label control-resize-mode='fixed' label-alignment='top-left' ni-control-id='8' text='Password'></ni-label>
</ni-cluster>
<ni-label control-resize-mode='fixed' label-alignment='top-left' ni-control-id='5' text='Login'></ni-label>
<ni-hyperlink binding-info='{"accessMode": "writeOnly", "dataItem": "dataItem_LoginHyperlink", "dco": 1, "isLatched": false, "prop": "href", "sync": false, "unplacedOrDisabled": false}' content='Login' control-resize-mode='fixed' follower-ids='["2"]'
href='' label-alignment='top-left' label-id='2' ni-control-id='3' readonly='true'></ni-hyperlink>
<ni-label class='ni-hidden' control-resize-mode='fixed' label-alignment='top-left' ni-control-id='2' text='Login hyperlink'></ni-label>
</ni-front-panel>
</div>
</body>

</html>

 

 

 

 
0 Kudos
Message 6 of 12
(3,866 Views)

What NXG Web Module version are you using?

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 7 of 12
(3,835 Views)

@irfanabid wrote:

What NXG Web Module version are you using?


Hi Irfanabid,

 

I am using the NXG Web Module 4.0

Thank you.

0 Kudos
Message 8 of 12
(3,819 Views)

Sorry for slow response.

 

I am still using the old NXG 3.0 so I'm not sure how different will it be with NXG 4.0. In 3.0, there is a html & CSS part of the code. So, we can simply modify the CSS. For your case, I don't see the CSS portion.

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
Message 9 of 12
(3,796 Views)
Solution
Accepted by topic author irfanabid

LabVIEW NXG Web Module 5.0 now includes the masked input control for entering sensitive information as shown in the following GIF

 

maskedinput.gif


Milan
Message 10 of 12
(3,715 Views)