Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hiding password input 1

Status
Not open for further replies.

grebo

Programmer
Sep 21, 1998
38
US
I've got a script that I've modified to password protect a link (you can't click through until you enter the correct user ID and password.) However, I cannot seem to figure out how to tell the program to display asteriks as oppsed to the actual password.<br>
<br>
I use the following line to get information on the password:<br>
var pass=prompt("What is your password?",'');<br>
<br>
Can anyone help me out here?<br>
<br>
-Grebo
 
Grebo,<br>
<br>
Can your script support a form with the appropriate HTML input box? <br>
<br>
Something like<br>
<br>
&lt;input type="password" name="txtPW" size="25" value="&lt;%=strPW %&gt;" onFocus=select()&gt;<br>
<br>
should work. (Ignore the 'value' and 'onFocus' pieces, they are from an ASP page that I use for logons.)<br>
<br>
Make a good day . . .<br>
. . . barn<br>
<br>
<br>

 
this quick page in html should work too; maybe open it with a script in the window that you want to display protected info in....then retreive the info from this page through<br>
now for the page:<br>
&lt;html&gt;<br>
&lt;head&gt;<br>
&lt;script language=javascript&gt;<br>
function sendinfo()<br>
{<br>
var xyz=window.opener.document;// &gt;&gt;set variables to opener window properties<br>
var zyx=document.forms[0]; //<br>
xyz.uid=zyx.uid.value; // &gt;&gt;These 2 lines send info to opener;<br>
xyz.pass=zyx.pass.value; //<br>
return false; //stop form action<br>
window.close; //close this window after sending info;<br>
}<br>
&lt;/script&gt;<br>
&lt;/head&gt;<br>
&lt;body bgcolor=fffff0 text=000000&gt;<br>
&lt;center&gt;<br>
&lt;table&gt;&lt;tr&gt;&lt;td&gt;<br>
&lt;form action=# onsubmit="sendinfo();"&gt;<br>
User ID: &lt;input name=uid&gt;&lt;br&gt;<br>
Password: &lt;input name=pass&gt;&lt;br&gt;<br>
&lt;center&gt;&lt;input type=submit onsubmit="sendinfo();" onclick="sendinfo();"&gt;&lt;/center&gt;<br>
&lt;/form&gt;<br>
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br>
<br>
<br>
This *should* work; but the references to window.opener.document.uid might be incorrect; I'm not sure on how to reference a variable on a diff. page.<br>
<br>
<br>
Hope this helps;<br>
-Robherc
 
Thanks. I'll have to give these a try in a little while (just got inundated with higher priorities today...)<br>
<br>
-Grebo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top