19.1. WML Password Input Fields

The type attribute is another useful attribute of the <input> element. Its value can be either text (default value) or password. If the value of the type attribute is text, the characters in the input field will be visible; if you change it to password, all characters in the input field will be displayed as asterisks (*). Note that data in password input fields will not be transmitted in a more secure way than that in ordinary input fields. The following WML example demonstrates how to create a password input field:


(inputEg2.wml)

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">

<wml>
  <card id="card1" title="Password Input Fields">
    <p>
      Please login before reading our WML tutorial.<br/><br/>
      User Name:
      <input type="text" name="name" maxlength="16" value="Jack"/><br/>
      Password:
      <input type="password" name="passwd" maxlength="10" value="abc"/>
    </p>
  </card>
</wml>


The result of the above WML example in WAP browsers is shown below:






Sony Ericsson T610





Sony Ericsson T68i





Nokia Mobile Browser 4.0


Previous Page Page 36 of 50 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.