Textarea helpers.

This commit is contained in:
Relintai 2021-11-16 17:34:01 +01:00
parent e99a82919d
commit 94381a3e42
3 changed files with 29 additions and 0 deletions

View File

@ -1546,6 +1546,29 @@ HTMLBuilder *HTMLBuilder::fdiv(const String &body, const String &cls, const Stri
return this;
}
HTMLTag *HTMLBuilder::textarea(const String &name, const String &cls, const String &id) {
HTMLTag *t = textarea();
t->name(name);
if (cls != "") {
t->cls(cls);
}
if (id != "") {
t->id(id);
}
return t;
}
HTMLBuilder *HTMLBuilder::ftextarea(const String &name, const String &body, const String &cls, const String &id) {
textarea(name, cls, id);
w(body);
ctextarea();
return this;
}
//Closing tags
HTMLBuilder *HTMLBuilder::ca() {

View File

@ -310,6 +310,9 @@ public:
HTMLTag *div(const String& cls, const String& id = "");
HTMLBuilder *fdiv(const String& body, const String& cls = "", const String& id = "");
HTMLTag *textarea(const String& name, const String& cls = "", const String& id = "");
HTMLBuilder *ftextarea(const String& name, const String& body, const String& cls = "", const String& id = "");
//closing tags c prefix means close
//Note simple tags should not have these like <br>
//Note that I might have a few that shouldn't be here, those will be removed as I find them

View File

@ -78,6 +78,9 @@ public:
static void db_save_all(const Vector<Ref<Resource> > &resources);
#endif
//add serialization to and from requests
//could also build a form validator automatically using the property registration api
//Resource::register<T>() foreach parents cast call
//RBACRank::register()