Hola. Lo que intento hacer es almacenar una variable en mi base de datos, que he leído desde PHP pero necesito usar decode() para que interprete los caracteres adecuadamente.
<script language="Javascript">
function submitForm() {
tinyMCE.triggerSave();
document.forms[0].submit();
}
</script>
<script language="javascript">
$(document).ready(function(){
$(':button').click( function(){
if(this.name == 'cancel')
{
$('#dialogContact').fadeOut();
$('.dialogBG').fadeOut();
}
else if(this.name == 'save')
{
var id = $('input[name=id]');
var desc_short = $('textarea[name=contentshort]');
var desc_long = $('textarea[name=content]');
var titel1 = $('input[name=titel]');
var from = $('input[name=from]');
var data = 'type=save' +
'&id=' + id.val() +
'&titel=' + titel.val() +
'&from=' + from.val() +
'&desc_short=' + desc_short.val() +
'&desc_long=' + desc_long.val();
$.ajax({
url: "Helper/NewsContent.php",
type: "POST",
data: data,
// datatype: "json",
success: function (reqCode)
{
$('#dialogContact').fadeOut();
$('.dialogBG').fadeOut();
if (reqCode == 1)
{
$.blockUI({
theme: true,
title: 'Complete',
message: '<p>Speichern erfolgreich</p>',
timeout: 1500
});
location.reload();
if($('#refresh_'+id.val()).length > 0)
{
//$('#refresh_'+id.val()).load("Helper/RefreshContent.php?id="+id.val());
//$(".button_img_delete").easyconfirm();
//$(".button_img_delete").live("click", $(".button_img_delete").easyconfirm());
//location.reload();
}
else
{
location.reload();
}
}
else if (reqCode == 2)
{
$.blockUI({
theme: true,
title: 'Fehler',
message: '<p>Das Anfangsdatum liegt nach dem Enddatum</p>',
timeout: 4000,
onUnblock: function(){
$('#dialogContact').fadeIn(400),
$('.dialogBG').fadeTo(200, 0.75)
}
});
}
else if (reqCode == 3)
{
$.blockUI({
theme: true,
title: 'Fehler',
message: '<p>Das eingegebene Datum ist ungültig</p>',
timeout: 4000,
onUnblock: function(){
$('#dialogContact').fadeIn(400),
$('.dialogBG').fadeTo(200, 0.75)
}
});
}
else if (reqCode == 4)
{
$.blockUI({
theme: true,
title: 'Warnung',
message: '<p>Die angegeben Daten sind gleich</p>',
timeout: 4000,
onUnblock: function(){
$('#dialogContact').fadeIn(400),
$('.dialogBG').fadeTo(200, 0.75)
}
});
}
}
});
return false;
}
});
/*$(function() {
$("#to").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
});*/
$(function() {
$("#from").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd'
});
});
});
</script>