aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-12-28 17:17:41 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-12-28 17:17:41 +0100
commit0f8ac3432252390dc46b600409ba6fc88e958e95 (patch)
treebb66505421eb0cc1e9201586d027200fdb89213c /src/html.cc
parent7149a1e3fc877a8c060cbf07e4325d636cc807ad (diff)
parent5486bedf18450ae4de413c4174a0175948c95c3e (diff)
merge with main
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/html.cc b/src/html.cc
index 0bfa0420..e3b961c5 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -215,6 +215,45 @@ void a_Html_load_images(void *v_html, DilloUrl *pattern)
}
/*
+ * Search for form
+ */
+static bool Html_contains_form(DilloHtml *html, void *v_form)
+{
+ for (int i = 0; i < html->forms->size(); i++) {
+ if (html->forms->get(i) == v_form) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/*
+ * Used by the "Submit form" form menuitem.
+ */
+void a_Html_form_submit(void *v_html, void *v_form)
+{
+ DilloHtml *html = (DilloHtml*)v_html;
+
+ if (Html_contains_form(html, v_form)) {
+ /* it's still valid */
+ a_Html_form_submit2(v_form);
+ }
+}
+
+/*
+ * Used by the "Reset form" form menuitem.
+ */
+void a_Html_form_reset(void *v_html, void *v_form)
+{
+ DilloHtml *html = (DilloHtml*)v_html;
+
+ if (Html_contains_form(html, v_form)) {
+ /* it's still valid */
+ a_Html_form_reset2(v_form);
+ }
+}
+
+/*
* Set the URL data for image maps.
*/
static void Html_set_link_coordinates(DilloHtml *html, int link, int x, int y)