Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
ASP.Net 6 MVC HTML TextEditor helper does not seem to be working
posted

I have the following code is ASP.Net 6 MVC application:

<div class="group-fields">
<label for="userId">User Id</label>
@(Html.Infragistics().TextEditor()
.ID("userId")
.InputName("userId")
.PlaceHolder("User Id")
.Render()
)
</div>
<div class="group-fields">
<label for="password">Password</label>
@(Html.Infragistics().TextEditor()
.ID("password")
.InputName("password")
.TextMode(TextEditorTextMode.Password)
.PlaceHolder("********")
.Render()
)
</div>

It renders the HTML like this, but the placeholders nor the password characters appear in the browser:

<div class="group-fields">
<label for="userId">User Id</label>
<input id="userId"></input>
<script type="text/javascript">$(function () {$('#userId').igTextEditor({ placeHolder: 'User Id', inputName: 'userId' });});</script><script Type='text/javascript'>(function ($) {$(document).ready(function () {var wm = $("#__ig_wm__").length > 0 ? $("#__ig_wm__") : $('<div id="__ig_wm__"></div>').appendTo(document.body);wm.css({position: 'fixed',bottom: 0,right: 0,zIndex: 1000}).addClass('ui-igtrialwatermark');});}(jQuery));</script>

</div>
<div class="group-fields">
<label for="password">Password</label>
<input id="password"></input>
<script type="text/javascript">$(function () {$('#password').igTextEditor({ textMode: 'password', placeHolder: '********', inputName: 'password' });});</script><script Type='text/javascript'>(function ($) {$(document).ready(function () {var wm = $("#__ig_wm__").length > 0 ? $("#__ig_wm__") : $('<div id="__ig_wm__"></div>').appendTo(document.body);wm.css({position: 'fixed',bottom: 0,right: 0,zIndex: 1000}).addClass('ui-igtrialwatermark');});}(jQuery));</script>

</div>

Any idea what I have done wrong?  I set up the JS and CSS includes according to the documentation.  Thanks.

Parents
  • 600
    Offline posted

    Hello Larry,

    Thank you for posting in our community!

    I have been looking into your question and I need to ask for some additional information to ensure that your question is addressed correctly.

    Could you please clarify what do you mean by "the placeholders nor the password characters appear in the browser"?

    I am asking this question because, on my side, when running the application, the two text editors are displayed as expected:

    Then, when typing the same text in the first and second text editor, the characters are displayed accordingly and as expected, i.e., the User Id editor displays the actual text, whereas the Password editor displays the same text as dots.

    If you require the password to be displayed as actual text, what I could suggest is setting the textMode option to text:

    @(Html.Infragistics().TextEditor()
        .ID("password")
        .InputName("password")
        .TextMode(TextEditorTextMode.Text)
        .PlaceHolder("********")
        .Render()
    )

    If this is not an accurate demonstration of what you are trying to achieve, please provide a small, isolated sample that demonstrates the behavior on your side along with steps to reproduce.

    Having a sample that I can debug on my side will be extremely helpful in further investigating this matter and providing you with a solution as soon as possible.

    Thank you for your cooperation. Looking forward to your reply.

    Sincerely,
    Riva Ivanova
    Associate Software Developer

Reply Children