This patch makes TEXTAREA controls submit their contents when their form is activated. Note that I reworked the handling of the embed and widget members of the form structure for TEXTAREA controls. This was because I was getting crashes and corruption when the form attempted to submit itself. I think the various coercions between (void *), (Widget *) and (Embed *) were going wrong. Changing things so that widget == embed is also more consistent with the way the other embedded form controls are handled. Regards, Jeremy Henty diff -pru -- dillo2-ref/src/html.cc dillo2-cur/src/html.cc --- dillo2-ref/src/html.cc 2007-12-16 22:40:25.000000000 +0000 +++ dillo2-cur/src/html.cc 2007-12-17 01:59:29.000000000 +0000 @@ -3792,6 +3792,11 @@ static void Html_submit_form2(DilloHtml entryres = (EntryResource*)((Embed*)input->widget)->getResource(); Html_append_input(DataStr, input->name, entryres->getText()); break; + case DILLO_HTML_INPUT_TEXTAREA: + MultiLineTextResource *textres; + textres = (MultiLineTextResource*)((Embed*)input->widget)->getResource(); + Html_append_input(DataStr, input->name, textres->getText()); + break; case DILLO_HTML_INPUT_CHECKBOX: case DILLO_HTML_INPUT_RADIO: ToggleButtonResource *cb_r; @@ -4240,7 +4245,7 @@ static void Html_tag_close_textarea(Dill form = html->forms->getRef (html->forms->size() - 1); form->inputs->get(form->inputs->size() - 1).init_str = str; widget = (Widget*)(form->inputs->get(form->inputs->size() - 1).widget); - ((MultiLineTextResource *)widget)->setText(str); + ((MultiLineTextResource *)((Embed *)widget)->getResource ())->setText(str); html->InFlags &= ~IN_TEXTAREA; } @@ -4292,12 +4297,10 @@ static void Html_tag_open_textarea(Dillo Widget *widget; Embed *embed; - widget = (Widget*)textres; - embed = new Embed(textres); - EntryResource *entryres = (EntryResource*)embed->getResource(); + widget = embed = new Embed(textres); /* Readonly or not? */ if (Html_get_attr(html, tag, tagsize, "readonly")) - entryres->setEditable(false); + textres->setEditable(false); Html_add_input(form, DILLO_HTML_INPUT_TEXTAREA, widget, embed, name, NULL, NULL, false);