开发者

.serialize contentEditable div?

I'm using (form).serialize to POST a form with ajax...

Something l开发者_JAVA百科ike:

    $.post("/ajax/post_message_action.php", $(form).serialize(), function (data) { ... }

The problem is that I want to use a contentEditable DIV instead of a

<textarea name="description">

Is this possible?

Thanks!


$.post("/ajax/post_message_action.php",
    $(form).serialize()+"&description="+$('div[name=description]').text() ,
function (data) { ... });


a. keep a hidden textarea element in the form.
b. on form submit, set the innerHTML of the div as the text in the textarea.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜