password_field(name = "", value = nil, size = 40, maxlength = nil) public

Generate a Password Input element as a string.

name is the name of the input field. value is its default value. size is the size of the input field display. maxlength is the maximum length of the inputted password.

Alternatively, attributes can be specified as a hash.

password_field("name")
  # <INPUT TYPE="password" NAME="name" SIZE="40">

password_field("name", "value")
  # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="40">

password_field("password", "value", 80, 200)
  # <INPUT TYPE="password" NAME="name" VALUE="value" SIZE="80" MAXLENGTH="200">

password_field("NAME" => "name", "VALUE" => "value")
  # <INPUT TYPE="password" NAME="name" VALUE="value">
Show source
Register or log in to add new notes.