ceegeye helper functions

submitbuttoncheck is a global ( in the ceegeye namespace ) function that aids in creating a form’s submission button. Client side it uses javascript to reference the name of the button being clicked and setting a hidden form element to have this value. The program then only need check the name of the hidden element to see which button was used on the form.

void submitbuttoncheck(xhtml& p,
                 const std::string& SubmitName,
                 const std::string& SubmitText,
                 const std::string& HiddenName,
                 const std::string& FormID,
                 const std::string& Class = "");

An example:
This code displays the form on the webpage.

p.form("form1", "/cgi-bin/theform.cgi");
p.inputhidden("pressed", "")
submitbuttoncheck(p, "button1", "Send Form", "pressed", "form1");
submitbuttoncheck(p, "button2", "Send Form", "pressed", "form1");
p.formend( );

The cgi that responds to this submission needs to do this:

string button;
if(cgiobject.GetValue("pressed", button)) {
  if(button == "button1") {
    // do something in response to this button click
  }
  else if(button == "button2") {
    // do something in response to this button click
  }
}

NoCache is a function that can be used in the pagebegin function of the xhtml class. It stops the browser caching the page e.g.

p.pagebegin("title", "", "/css/format.css", NoCache( ));

xhtml info:- http://www.w3.org
email: ceegeye