Submit text from a contenteditable div via jquery ajax
I want to submit text from a div, while preventing a browser reload. I did
read the jQuery documentation, but I couldnt figure this out, so I would
greatly appreciate some specific instruction.
My form is styled to display: none. This is where I gave up. Not sure if
I'm even on the right track:
$('.focus').click(function() {
var str = $(".focus").text(function(){
$.post('/main', $(".focus_form").serialize( str ));
});
});
Thank you
To resolve the problem, I set the val of the input. Thought I would post
this incase another noob lands here with a similar situation.
var str = $(".focus").text();
$('.focus_input').val( str );
$.post("/main", $(".focus_form").serialize());
alert( str );
No comments:
Post a Comment