EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: James on April 26, 2020, 01:44:23 AM



Title: How to set $.messager.prompt input type to password
Post by: James on April 26, 2020, 01:44:23 AM
It default is text, is there any way to set it


Title: Re: How to set $.messager.prompt input type to password
Post by: jahangir on April 26, 2020, 03:25:39 AM
use this code

Code:

var dlg = $.messager.prompt('Enter Password', 'Please enter password', function(r){
 if (r){
   alert('you type: '+r);
 }
});
       
dlg.find('.messager-input').attr('type', 'password');



Please refer to this example

http://code.reloado.com/jbhatti/29/edit#html,live
 (http://code.reloado.com/jbhatti/29/edit#html,live)



Title: Re: How to set $.messager.prompt input type to password
Post by: James on April 27, 2020, 04:30:18 AM
use this code

Code:

var dlg = $.messager.prompt('Enter Password', 'Please enter password', function(r){
 if (r){
   alert('you type: '+r);
 }
});
       
dlg.find('.messager-input').attr('type', 'password');



Please refer to this example

http://code.reloado.com/jbhatti/29/edit#html,live
 (http://code.reloado.com/jbhatti/29/edit#html,live)



Nice , your code is better , I just do like this

Code:
$.messager.prompt('Enter Password', 'Please enter password', function(r){
 if (r){
   alert('you type: '+r);
 }
});
       
$('.messager-input').attr('type', 'password');