os_input_password
|
 |
An input password field within a
form.
An os_input_password
is a single-line text entry field within an os_form
, and is identified by a name. The name is specified in a constructor and can be
modified through the name() member function. An
initial value, or contents, for an os_input_password
can be specified either in a constructor or through the value()
member function.
The number of characters displayed
on the screen, or the width of the os_input_password
element, can be specified in a constructor or through the size()
member function. An os_input_password differs from
an os_input_text in that characters are displayed
as asterisks as they are entered within the os_input_password
.
By default, an os_input_password
can accept an unlimited number of characters. The maximum number of characters
that the os_input_password can accept can be
specified through the maxlength() member function.
If characters are entered beyond the specified size, the os_input_password
scrolls up to the maximum length specified either in the constructor or through
the maxlength() member function.
When an os_input_password
is the only input element within an os_form ,
browsers typically interpret pressing the Enter
key within the os_input_password as a request to
submit the form.
Declaration
#include <ospace/web/inpasswd.h>
class os_input_password : public os_element
Interface
Constructor
os_input_password(
const string& name )
Constructs an input
password field with name name .
Constructor
os_input_password(
const string& name ,
const string& value )
Constructs an input
password field with name name and value value
.
Constructor
os_input_password(
const string& name ,
const string& value ,
int size )
Constructs an input
password field with name name , value value
, and input display size characters.
Constructor
os_input_password(
const string& name ,
const string& value ,
int size ,
int maxlength )
Constructs an input
password field with name name , value value
, input display size characters, and maximum input
length maxlength characters.
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the input password field.
maxlength
int
maxlength() const
Returns the maximum input
length in characters, or 0 if not set.
maxlength
os_input_password&
maxlength( int maxlength )
Sets the maximum input
length to maxlength characters and returns a
reference to the input password field.
name
string
name() const
Returns the name.
name
os_input_password&
name( const string& name )
Sets the name to name
and returns a reference to the input password field.
size
os_input_password&
size( int size )
Sets the input display to size
characters and returns a reference to the input password field.
size
int
size() const
Returns the input display
size in characters, or 0 if not set.
value
string
value() const
Returns the value, or the
empty string if not set.
value
os_input_password&
value( const string& value )
Sets the value to value
and returns a reference to the input password field.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved