So the textarea is now showing, but there's a problem with saving the text now.
When i press save, the new text shows, but it does not update the MySQL. Because when I press refresh, it disappears.
Here's what i have.
The save function:
Code:
$('.todo a.saveChanges').live('click',function(){
var text = currentTODO.find("textarea").val();
$.get("ajax.php",{'action':'edit','id':currentTODO.data('id'),'text':text});
currentTODO.removeData('origText')
.find(".text")
.text(text);
});
Which leads to the "edit case" in ajax.php:
Code:
case 'edit':
ToDo::edit($id,$_GET['text']);
break;
That calls the function for updating the database:
Code:
public static function edit($id, $text){
$text = self::esc($text);
if(!$text) throw new Exception("Wrong update text!");
mysql_query(" UPDATE tabel
SET text='".$text."'
WHERE id=".$id
);
if(mysql_affected_rows($GLOBALS['link'])!=1)
throw new Exception("Couldn't update item!");
}
This worked before we changed to the textarea

Can you see why?
/Morten