Got it. Itâs now getting difficult for me since I do not really know what I am looking for.
However, at least I found the following in the code:
edit: 1) code of the displaying website by clicking view page source
Right before the code for displaying the values which Iâve posted above, thereâs a form mentioned:
<form id="werte" action="#" onsubmit="saveValues(this);return false;"><div id="content">
edit: 2) code of the displaying website by clicking view page source
The code of the save-button looks like this:
<div class="button left" onclick="document.forms['werte'].onsubmit();"><div class="bg_r"> </div><a>Speichern</a></div> </div>
I tried to find out what happens when the save button is clicked with the dev tool of chrome like you recommended. As far as I understand the relvant code is in âscripts.jsâ - but actually there are running a lot of javascripts⊠Please find the code within scripts.js which has something to do with âsaveâ(German: speichern):
edit: 3) code within scripts.js which was found by Network log of Chrome developer tool. Script.js is running when clicking the save button. Indeed, there are running approx. 20 other .jsâ also, but the others seem to have nothing to do with saving the values.
//edit: whole function now shown
[...]
function saveChange(form,id,otto)
{
//alert(form[0].value); // for debugging
if (saveChangeRunning)
return;
saveChangeRunning = true;
var params = "?msg=";
var page = "./confirm.php";
var error = false;
var dataString = '';
//Bei Fehlern können wir nicht abspeichern
for (bid in errorBrain) {
//Noch ein Fehler gespeichert?
if (errorBrain[bid]==1)
{
if (!error) params += "UngĂŒltige Angaben können nicht gespeichert werden, bitte angezeigte Fehler korrigieren!";
error = true;
}
}
//Fortsetzen?
if (!error)
{
var success = false;
var warning = false;
if (id=='')
{
//Array speichern
if(otto)
var data = $("#welcome_form").serializeArray();
else
var data = $("#werte").serializeArray();
dataString = JSON.stringify(data);
}
else
{
//Einzelnen Wert speichern
var val = getValue(id,'');
if (val)
{
var output = eval("document.getElementById(id+'info')");
if (output)
{
output.value = val;
dataString = '[{"name":"'+id+'","value":"'+val+'"}]';
}
}
hide(id);
}
if (dataString!='')
{
if(otto)
var seite = "./ersteinst.php";
else
var seite = "./save.php";
//console.log(dataString); // for debugging
$.post(seite, {data: dataString}, function(answer)
{
//alert(answer); // for debugging
//console.log(answer);
var results = JSON.parse(answer);
//Erfolg?
if (results['success']==true)
success = true;
else if (results['warning']==true)
{
success = true;
warning = true;
}
else
{
//Fehler ĂŒbergeben?
if (results['errors'])
{
var errors = results['errors'];
for (webID in errors)
{
var errormsg = errors[webID];
//Fehler bei Feld webID!
var $cal = $("#calval"+webID);
$cal.addClass("fehler");
errorBrain['val'+webID] = 1;
//Fehlermeldung ausgeben => muss spÀter der Infotext wiederhergestellt werden?
$cal.children("div.green").children("p").html(errormsg);
}
}
}
if (results['message']!=undefined && results['message']!="")
params += escape(results['message']);
if (otto && results['url']!="" && results['url']!=undefined)
params += "&"+"url="+results['url']; // OTTO
//Was passiert nun?
if (!success)
page = "./error.php";
else
if (warning)
page = "./warning.php";
params += "&KeepThis=true&TB_iframe=true&height=140&width=420";
//Meldung
tb_show('',page+params);
if (!otto)
form.target=$('#TB_iframeContent').attr('name');
//Alle Ănderungen sind gesichert
if (success)
valueChanged = false;
saveChangeRunning = false;
}, 'text');
} else
{
error = true;
params += "Es wurde kein zu sichernder Wert gefunden!";
}
}
if (error)
{
var errorShown = false;
//Dashboard? Meldung anzeigen!
var $containerDiv = $("#"+id+"edit");
if ($containerDiv)
{
var msgDiv = $containerDiv.children("div.dashboardmsg");
if (msgDiv)
{
msgDiv.css("display","block");
errorShown = true;
setTimeout(function(){msgDiv.css("display","none")},6000);
}
}
//Nicht doppelt anzeigen
if (errorShown)
{
page = "./error.php";
params += "&KeepThis=true&TB_iframe=true&height=140&width=420";
//Meldung
tb_show('',page+params);
form.target=$('#TB_iframeContent').attr('name');
}
saveChangeRunning = false;
}
else
{
//Dashboard? Meldung ausblenden!
var $containerDiv = $("#"+id+"edit");
if ($containerDiv)
{
var msgDiv = $containerDiv.children("div.dashboardmsg");
if (msgDiv)
msgDiv.css("display","none");
}
closeAllBoxes();
}
}
edit: 4) code within script.js ==> function saveValues:
[...]
function saveValues(f)
{
saveChange(f,'');
return false;
}
[...]
edit: If I understand correctly the saveValues function is just firing the saveChange function from above?
The mentioned save.php
is the msgbox which confirms that the values were saved. The code is just the following (nothing more):
edit: code added
{success: true, message: "Die Einstellungen wurden erfolgreich gespeichert."}
message: "Die Einstellungen wurden erfolgreich gespeichert."
success: true
As fas as I understand the values themselves seems to be stored in werte
(German word for values) as this appears several times in the relevant code. But I could not find anything furtherâŠ
Hopefully these information are somehow helpful?
And once again, many thanks that you are guiding my step by step and hint by hint!