From f512c2e0c403077a1019f3fc6e829821f37edf42 Mon Sep 17 00:00:00 2001 From: adri Date: Sun, 30 Dec 2018 18:41:58 +0100 Subject: [PATCH] #3 close, select slvl done --- script.js | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/script.js b/script.js index b2fed15..566bd54 100644 --- a/script.js +++ b/script.js @@ -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(''); + className = j.attr('class'); + if(className == "sl") + { + val = ltrim(j.html()); + j.html('') + } + else + { + inputOptions = ''; + if(className=="pw") + inputOptions += 'type="password" data-oldpw="'+ltrim(j.html())+'" '; + else if (j.attr('class') == "datene") + inputOptions += 'type="date" ' + 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); }