#3 close, select slvl done
This commit is contained in:
parent
21ebc5efd3
commit
f512c2e0c4
31
script.js
31
script.js
|
@ -8,12 +8,25 @@ $(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]);
|
||||||
inputOptions = '';
|
className = j.attr('class');
|
||||||
if(j.attr('class')=="pw")
|
if(className == "sl")
|
||||||
inputOptions += 'type="password" data-oldpw="'+ltrim(j.html())+'" ';
|
{
|
||||||
else if (j.attr('class') == "datene")
|
val = ltrim(j.html());
|
||||||
inputOptions += 'type="date" '
|
j.html('<select>\
|
||||||
j.html('<input '+inputOptions+' value="'+(j.attr('class')=="pw"?'':ltrim(j.html()))+'" />');
|
<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]);
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue