locked
Password Box in HTML client? RRS feed

  • Question

  • hai all...
    how to set "text box" to "password box" in HTML Client

    Friday, May 31, 2013 6:16 AM

Answers

  • I'm assuming you don't want the characters displayed in this textbox.

    You can probably use jQuery to assign a class or attribute on the render or postrender event.


    Brian

    • Marked as answer by olipiskandar Tuesday, June 4, 2013 2:55 PM
    Friday, May 31, 2013 5:40 PM
  • An HTML input password type object can be inserted in the DOM using the standard render methods.

    jQuery does have password selector syntax if needed.

    Saturday, June 1, 2013 5:22 AM

All replies

  • I'm assuming you don't want the characters displayed in this textbox.

    You can probably use jQuery to assign a class or attribute on the render or postrender event.


    Brian

    • Marked as answer by olipiskandar Tuesday, June 4, 2013 2:55 PM
    Friday, May 31, 2013 5:40 PM
  • An HTML input password type object can be inserted in the DOM using the standard render methods.

    jQuery does have password selector syntax if needed.

    Saturday, June 1, 2013 5:22 AM
  • finnaly, this code work for me !!!
    Reference : joe binder

    myapp.addrecord.test2_render = function (element, contentItem) {
        // Write code here.
        var pass = $("<input id='test2' type='password'/>");
            pass.appendTo($(element));
    
            pass.change(function () {
                if (contentItem.value != pass.val()) {
                    contentItem.value = new String(pass.val());
                }
            });
    
            contentItem.dataBind("stringValue", function (newValue) {
            pass.val(newValue);
        });
    };
    thanks all...

    • Proposed as answer by MauricioVieira Tuesday, October 15, 2013 4:13 AM
    • Unproposed as answer by MauricioVieira Tuesday, October 15, 2013 4:13 AM
    Tuesday, June 4, 2013 2:47 PM
  • Put the field as a normal Text Box, and use the follow Post Render Event (at this textbox):

    $(element).find("input").get(0).type = "password";


    Tuesday, October 15, 2013 4:16 AM
  • I wanted to post a reply to this. I had a very basic requirement and that was to mask the password in the HTML page. The code above worked but it added "appended" another text box with the masked password. I changed the code from "appendTo" to "replaceAll" and this worked great.

    myapp.AddEditAgentTemplates.ClosePassword_postRender = function (element, contentItem) {
        // Write code here.
        var pass = $("<input id='ClosePassword' type='password'/>");
        pass.replaceAll($(element));
    
        pass.change(function () {
            if (contentItem.value != pass.val()) {
                contentItem.value = new String(pass.val());
            }
        });
    
        contentItem.dataBind("stringValue", function (newValue) {
            pass.val(newValue);
        });

     
    Monday, January 6, 2014 11:46 PM
  • Perfect!!
    Friday, May 20, 2016 12:36 AM