htmlInputSubmit
Input submit button control class
[Previous] [Main] [Next]


Description
htmlInputSubmit encapsulates the <INPUT TYPE="SUBMIT"></INPUT> tags. Submit buttons invoke the action component of a form, submitting data entered in controls on the form to a web server for processing.  
 
Declaration
#include <dcmicro/htmlpp/submit.h>  
 
Hierarchy
htmlinputsubmit.gif  
 
See Also
htmlForm, htmlInputReset, htmlInputImage  
 
Related Constants/Definitions
None.  
 
Constructors
htmlInputSubmit()  
Constructs an standard submit button object.  
 
htmlInputSubmit( const String& button_label )  
Constructs a submit button object using display label button_label.  
 
htmlInputSubmit( const String& button_label, const String& name )  
Constructs a submit button object named name, using display label button_label.  
 
Destructor
virtual ~htmlInputSubmit()  
Destroys the object.  
 
Member Methods
LabelhtmlInputSubmit& Value(const String& button_label )  
Sets the displayed button label value to button_label, and returns a reference to the object.  
 
LabelString Value() const  
Returns the button label value as a string, or an empty string if not set.  
 
NamehtmlInputSubmit& Name(const String& name )  
Sets the name used to reference the control on a form to name, and returns a reference to the object.  
 
NameString Name() const  
Returns the control name as a string, or an empty string if not set.  
 
ClonehtmlObject FAR * Clone() const  
Returns a base-class pointer to a deep copy of the object.  
 
Example Use
 
See Also: Tutorial:Forms:Buttons  
 
#include <stdio.h>  
#include <stdlib.h>  
#include <dcmicro/htmlpp/htmlpp.h>  
 
int main( void )  
{  
   htmlCgi   server ;  
   htmlPage  page( "html++ example application" ) ;  
 
   //  Create a form, setting the action  
   //  statement to "/cgi-bin/formdemo"  
   htmlForm   form( "/cgi-bin/formdemo" );  
 
   //  Set up input areas for last name,  
   //  first name, and email address. Allow  
   //  up to 20 characters for the names,  
   //  and 30 characters for the email.  
   form << "Last Name: "   
        << htmlInputText( "lname", 20 )  
        << htmlBreak() ;  
 
   form << "First Name: "  
        << htmlInputText( "fname", 20 )  
        << htmlBreak() ;  
 
   form << "Email address: "  
        << htmlInputText( "email", 30 )  
        << htmlBreak() ;  
 
   //  Add a submit button with a custom label  
   form << htmlCenter( htmlInputSubmit("Press to continue") );  
 
   page << form ;  
 
   server << page ;  
   return 0 ;  
}  
 
Program Output
 
Content-Type: text/html  
<HTML>  
<HEAD>  
<TITLE>html++ form input example</TITLE>  
</HEAD>  
<BODY>  
<FORM ACTION="/cgi-bin/formdemo" METHOD="POST">  
Last Name: <INPUT TYPE="TEXT" NAME="lname" SIZE="20"><BR>  
First Name: <INPUT TYPE="TEXT" NAME="fname" SIZE="20"><BR>  
Email address: <INPUT TYPE="TEXT" NAME="email" SIZE="30"><BR>  
<CENTER><INPUT TYPE="SUBMIT" VALUE="Press to continue"></CENTER></FORM>  
</BODY>  
</HTML>  
 
form1.gif  
 
 






©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.