#3 close, select slvl done

This commit is contained in:
adri 2018-12-30 18:41:58 +01:00
parent 21ebc5efd3
commit f512c2e0c4
1 changed files with 22 additions and 9 deletions

View File

@ -8,12 +8,25 @@ $(function() {
for(i=0; i<$("td", $(this).parent().parent()).length-1;i++)
{
j= $($("td", $(this).parent().parent())[i]);
inputOptions = '';
if(j.attr('class')=="pw")
inputOptions += 'type="password" data-oldpw="'+ltrim(j.html())+'" ';
else if (j.attr('class') == "datene")
inputOptions += 'type="date" '
j.html('<input '+inputOptions+' value="'+(j.attr('class')=="pw"?'':ltrim(j.html()))+'" />');
className = j.attr('class');
if(className == "sl")
{
val = ltrim(j.html());
j.html('<select>\
<option value="1" '+(val=="1"?'selected':'')+'>1</option>\
<option value="5" '+(val=="5"?'selected':'')+'>5</option>\
<option value="10" '+(val=="10"?'selected':'')+'>10</option>\
</select>')
}
else
{
inputOptions = '';
if(className=="pw")
inputOptions += 'type="password" data-oldpw="'+ltrim(j.html())+'" ';
else if (j.attr('class') == "datene")
inputOptions += 'type="date" '
j.html('<input '+inputOptions+' value="'+(j.attr('class')=="pw"?'':ltrim(j.html()))+'" />');
}
}
});
@ -34,9 +47,9 @@ $(function() {
j= $(tds[i]);
className = j.attr('class');
if(className == "pw" && data === true)
value = $('input', j).data("oldpw");
value = $('input,select', j).data("oldpw");
else
value = $('input', j).val();
value = $('input,select', j).val();
dataToSend[className] = value;
}
$.post("post.php", dataToSend, function(data){
@ -50,7 +63,7 @@ $(function() {
if(className == "pw")
value = data.pw;
else
value = $('input', j).val();
value = $('input,select', j).val();
dataToSend[className] = value;
j.html(value);
}