Forum OpenACS Q&A: Re: Question about html area

Collapse
Posted by Miguel Marin on
I wil try to explain it as well as I can:

I have a site that works well with Htmlarea, now I have a new applet were I will capture some information. The intention is to append the new capture text to the one that gives me the hrmlarea to put the two of them together in the DB.

I take out the original post button and made an extra form by my own like this

<form><input type=button  value=post onclick=post_mml();/>
</form>

To capture the text I made this javascript function that first capture the second applet text named equation and put it in a hidden message form field. The text that comes from the htmlarea is in the form message field content, so I alert the content value text but the doesnt appear, only does it when the htmlarea_p parameter is set to 0

function post_mml(action) {
    // This fetches the second applet text.
    mml_string = document.equation.getMathML();
    // This fill the hidden input content
    document.message.body.value = mml_string;
    // sets the hidden input action in the form message
    document.message.action.value = =\"post\"
    alert(document.message.content.value);
    //submit the form
    document.message.submit();
    }

I hope I made myself clear.