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