#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,13 +8,26 @@ $(function() {
for(i=0; i<$("td", $(this).parent().parent()).length-1;i++) for(i=0; i<$("td", $(this).parent().parent()).length-1;i++)
{ {
j= $($("td", $(this).parent().parent())[i]); j= $($("td", $(this).parent().parent())[i]);
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 = ''; inputOptions = '';
if(j.attr('class')=="pw") if(className=="pw")
inputOptions += 'type="password" data-oldpw="'+ltrim(j.html())+'" '; inputOptions += 'type="password" data-oldpw="'+ltrim(j.html())+'" ';
else if (j.attr('class') == "datene") else if (j.attr('class') == "datene")
inputOptions += 'type="date" ' inputOptions += 'type="date" '
j.html('<input '+inputOptions+' value="'+(j.attr('class')=="pw"?'':ltrim(j.html()))+'" />'); j.html('<input '+inputOptions+' value="'+(j.attr('class')=="pw"?'':ltrim(j.html()))+'" />');
} }
}
}); });
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@ -34,9 +47,9 @@ $(function() {
j= $(tds[i]); j= $(tds[i]);
className = j.attr('class'); className = j.attr('class');
if(className == "pw" && data === true) if(className == "pw" && data === true)
value = $('input', j).data("oldpw"); value = $('input,select', j).data("oldpw");
else else
value = $('input', j).val(); value = $('input,select', j).val();
dataToSend[className] = value; dataToSend[className] = value;
} }
$.post("post.php", dataToSend, function(data){ $.post("post.php", dataToSend, function(data){
@ -50,7 +63,7 @@ $(function() {
if(className == "pw") if(className == "pw")
value = data.pw; value = data.pw;
else else
value = $('input', j).val(); value = $('input,select', j).val();
dataToSend[className] = value; dataToSend[className] = value;
j.html(value); j.html(value);
} }