I have been experimenting with Jeditable, and i have got it to update normal tags as .edit... but it will not update
with .editArea
Plus when it updates the normal the update is not shown until i update the page..
I am not sure what i am doing wrong, and some help would be appreciated :)
Code:
<div>
<h2 id='<?= $row['id']?>' class="edit"> <?= $row['title']?></h2>
<p class="editArea"><?= $row['Text'] ?></p>
</div>
<?php
}
?>
$(document).ready(function() {
var text = 20;
$('.edit').editable('http://www.JapSeyz.dk/save.php?type=header', {
indicator : 'Saving...',
submit : 'OK',
id : 'id',
name : 'value',
tooltip : 'Click to edit...'
});
$('.editArea').editable('http://www.JapSeyz.dk/save.php?type=text', {
type : 'textarea',
submit : 'OK',
id : 'id',
name : 'value',
rows : '6',
cols : '100',
indicator : '<img src="img/indicator.gif">',
tooltip : 'Click to edit...'
});
});
(I left all the require/styling etc out.. )
And the update script
<?php
require("Oese/Connection.php");
$type = (isset($_GET['type'])) ? $_GET['type'] : "";
$value = (isset($_POST['value'])) ? $_POST['value'] : "";
$id = (isset($_POST['id'])) ? $_POST['id'] : "";
if($type == "text"){
mysql_query("UPDATE Oese SET Text='$value' WHERE id='$id'");
}
elseif($type == "header"){
mysql_query("UPDATE Oese SET title='$value' WHERE id='$id'");
}
print $value;
?>