Totalview is a property of $model1 and resides in the MySQL database. (Any thoughts on which data type is best?)
Somewhere in my Javascript (using jQuery) I fill the textarea using:
$('#Offer_Totalview').val(textForOverview);
This seems to be working fine. I see the text in the textarea in my HTML form. However when I save my model to the database, the value of my textarea is not saved. Before saving, I loop over the model to see what data the fields hold. And indeed $model1->Totalview is empty.
When I give $model1->Totalview a value manually, the value is saved to the database without problems.
My guess is that I shouldn’t use $(’#Offer_Totalview’).val(textForOverview) but what then? I have also used $(’#Offer_Totalview’).html(textForOverview)which does show the text but nothing in the database.
and read the value of the property when saving, I do see that $model1->Totalview has the value that was set using jQuery. Nothing in the database however…
I don’t think textareas have values. Their content is set between the <textarea></textarea> tags. However, this conversation implies that jQuery will handle that for you.
The weirdest thing… I have create a temporary value/property and given it the value of the textarea. That was saved to the database. When opening I reverse this. And everything works fine now. Don’t ask me why it works but it does. Maybe when I have more time I will try to figure out why.