Andrew Boyson / web

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Sat Apr 06 11:32:45 2019 +0000
Parent:
83:0d956edd55b7
Child:
85:fcffd89028c0
Commit message:
Added option for a suffix to an input

Changed in this revision

page/page.c Show annotated file Show diff for this revision Revisions of this file
page/page.h Show annotated file Show diff for this revision Revisions of this file
--- a/page/page.c	Sat Apr 06 11:21:14 2019 +0000
+++ b/page/page.c	Sat Apr 06 11:32:45 2019 +0000
@@ -187,6 +187,13 @@
     HttpAddF   ("  <input type='text' style='width:%.1fem;' id='%s' onchange='AjaxRequest(\"%s=\" + this.value)'>\r\n", inputwidth, id, name);
     HttpAddText("</div>\r\n");
 }
+void PageAddAjaxInputSuffix(char* label, float inputwidth, char* id, char* name, char* suffix)
+{
+    HttpAddText("<div class='line'>\r\n");
+    HttpAddF   ("  <div>%s</div>\r\n", label);
+    HttpAddF   ("  <input type='text' style='width:%.1fem;' id='%s' onchange='AjaxRequest(\"%s=\" + this.value)'>%s\r\n", inputwidth, id, name, suffix);
+    HttpAddText("</div>\r\n");
+}
 void PageAddAjaxLabelled(char* label, char* id)
 {
     HttpAddText("<div class='line'>\r\n");
--- a/page/page.h	Sat Apr 06 11:21:14 2019 +0000
+++ b/page/page.h	Sat Apr 06 11:32:45 2019 +0000
@@ -33,4 +33,5 @@
 extern void PageAddAjaxLabelled        (char* label,                   char* id);
 extern void PageAddAjaxLabelledSuffix  (char* label,                   char* id, char* suffix);
 extern void PageAddAjaxInputToggle     (char* label,                   char* id, char* name);
-extern void PageAddAjaxInput           (char* label, float inputwidth, char* id, char* name);
\ No newline at end of file
+extern void PageAddAjaxInput           (char* label, float inputwidth, char* id, char* name);
+extern void PageAddAjaxInputSuffix     (char* label, float inputwidth, char* id, char* name, char* suffix);