summaryrefslogtreecommitdiff
path: root/src/form.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/form.cc')
-rw-r--r--src/form.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/form.cc b/src/form.cc
index a36cd13a..219b3b5d 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -76,7 +76,6 @@ class DilloHtmlForm {
DilloHtml *html;
void eventHandler(Resource *resource, EventButton *event);
- void submit(DilloHtmlInput *active_input, EventButton *event);
DilloUrl *buildQueryUrl(DilloHtmlInput *active_input);
Dstr *buildQueryData(DilloHtmlInput *active_submit);
char *makeMultipartBoundary(iconv_t char_encoder,
@@ -113,6 +112,7 @@ public:
~DilloHtmlForm ();
DilloHtmlInput *getInput (Resource *resource);
DilloHtmlInput *getRadioInput (const char *name);
+ void submit(DilloHtmlInput *active_input, EventButton *event);
void reset ();
void addInput(DilloHtmlInput *input, DilloHtmlInputType type);
};
@@ -206,6 +206,16 @@ void a_Html_input_delete (DilloHtmlInput *input)
delete input;
}
+void a_Html_form_submit2(void *vform)
+{
+ ((DilloHtmlForm *)vform)->submit(NULL, NULL);
+}
+
+void a_Html_form_reset2(void *vform)
+{
+ ((DilloHtmlForm *)vform)->reset();
+}
+
/*
* Form parsing functions
*/
@@ -945,7 +955,7 @@ void DilloHtmlForm::eventHandler(Resource *resource, EventButton *event)
{
MSG("DilloHtmlForm::eventHandler\n");
if (event && (event->button == 3)) {
- MSG("Form menu\n");
+ a_UIcmd_form_popup(html->bw, html->page_url, this);
} else {
DilloHtmlInput *input = getInput(resource);
if (input) {
@@ -996,7 +1006,7 @@ DilloUrl *DilloHtmlForm::buildQueryUrl(DilloHtmlInput *active_input)
_MSG("DilloHtmlForm::buildQueryUrl: action=%s\n",URL_STR_(action));
- if (num_submit_buttons > 0) {
+ if (active_input && num_submit_buttons > 0) {
if ((active_input->type == DILLO_HTML_INPUT_SUBMIT) ||
(active_input->type == DILLO_HTML_INPUT_IMAGE) ||
(active_input->type == DILLO_HTML_INPUT_BUTTON_SUBMIT)) {
@@ -1727,6 +1737,7 @@ void DilloHtmlInput::reset ()
switch (type) {
case DILLO_HTML_INPUT_TEXT:
case DILLO_HTML_INPUT_PASSWORD:
+ case DILLO_HTML_INPUT_INDEX:
{
EntryResource *entryres = (EntryResource*)embed->getResource();
entryres->setText(init_str ? init_str : "");