[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

password mode

Posted on 2011-10-21
7
Medium Priority
?
368 Views
Last Modified: 2012-05-12
how can I  change to textbox to password mode on javascript? you cannot set emtpy message property and the textmode = password in same time thats why I am asking on javascript... This is RadTextbox.
0
Comment
Question by:1jaws
7 Comments
 
LVL 83

Accepted Solution

by:
leakim971 earned 1000 total points
ID: 37009574
0
 

Author Comment

by:1jaws
ID: 37009593
only third one made sense, I dont want to use Watermark.. What I need  Use Textmode = Singleline Then onfocus change type of textbox textmode to password... how can I write that function?
0
 
LVL 83

Assisted Solution

by:leakim971
leakim971 earned 1000 total points
ID: 37009655
you can't change text mode (type attribute of an input)
instead use two RadTextbox at the same position (use css margin-top & margin-left on the password)
onfocus display the password, hide the text
onblur hide the password, display the text
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 9

Assisted Solution

by:experts1
experts1 earned 500 total points
ID: 37012241
Use a DIV with textbox and change innerHTML as below example:

<title>Change Textbox To Password Type</title>
<SCRIPT language=JavaScript type=text/javascript>

     var passStr = "Text Mode = PASSWORD <br>";
     passStr = passStr + "<input type='password'>";

     var normStr = "Text Mode = NORMAL <br>";
     normStr = normStr + "<input type='text' id='txt_norm' value='TYPE Something' onFocus='clearText(this.value)'>";

 function textNorm() {
     document.getElementById('mode_box').innerHTML = normStr;
}
 function textPass() {
     document.getElementById('mode_box').innerHTML = passStr;
}
 function clearText(textVal) {
     if (textVal == 'TYPE Something') document.getElementById('txt_norm').value = "";
}
</script>
</head>
<body>

<input type='button' value='TEXT MODE' onClick='textNorm()'>
<br>
<input type='button' value='PASS MODE' onClick='textPass()'>
<br>
<br>
<div id='mode_box'>
Text Mode = Normal
<br>
<input type='text' id='txt_norm' value='TYPE Something' onFocus='clearText(this.value)'>
</div>
</body>
</html>
0
 

Author Comment

by:1jaws
ID: 37067275
thank you for replying, i will look at that...
0
 
LVL 61

Assisted Solution

by:HainKurt
HainKurt earned 500 total points
ID: 37140701
"you cannot set emtpy message property and the textmode = password in same time"

are you sure about this?

text="" textmode = "password"

0
 

Author Closing Comment

by:1jaws
ID: 37218166
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month20 days, 4 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question