#ifndef CONTENT_H
#define CONTENT_H
#include <cppcms/view.h>
#include <cppcms/form.h>
#include <iostream>
namespace content {
info_form()
{
sex.message("Sex");
martial.message("Martial State");
age.message("Your Age");
submit.value("Send");
add(name);
add(sex);
add(martial);
add(age);
add(submit);
sex.add("Male","m");
sex.add("Female","f");
martial.add("Single","s");
martial.add("Married","m");
martial.add("Divorced","d");
name.non_empty();
age.range(0,120);
}
{
if(!form::validate())
return false;
if(martial.selected_id()!="s" && age.value()<18) {
martial.valid(false);
return false;
}
return true;
}
};
std::string name,who;
double age;
info_form info;
};
}
#endif