Jump to content

Watermark Issue


unemployment

Recommended Posts

I want my watermark password field to say password and not be written in all asterisks. I know that this is because I am using type=password on my input field. I'm not sure how to make the type be text while displaying the password in asterisks.

 

You can see the problem on my site at http://network.jasonbiondo.com

 

Here is the code:

 

<div id="username">
   
                  <input id="username-field" class="loginFields" type="text" name="username" title="Username" value="Username" />
                  
                  <script type="text/javascript">
                  
                       //<![CDATA[
                       document.getElementById('username-field').onfocus = function() { if (this.value == 'Username') this.value=''; };
                       document.getElementById('username-field').onblur = function() { if (this.value == '') this.value = 'Username'; };
                       //]]>
                       
                  </script>

              </div>

              <div id="password">
   
                  <input id="password-field" class="loginFields" type="password" name="password" title="Password" value="Password" />
                  
                  <script type="text/javascript">
                  
                       //<![CDATA[
                       document.getElementById('password-field').onfocus = function() { if (this.value == 'Password') this.value=''; };
                       document.getElementById('password-field').onblur = function() { if (this.value == '') this.value = 'Password'; };
                       //]]>
                       
                  </script>
           
              </div>

Link to comment
https://forums.phpfreaks.com/topic/216912-watermark-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.