From 8a3d0538167eca9d376e5e825e9b9318f740543e Mon Sep 17 00:00:00 2001 From: adri Date: Sun, 30 Dec 2018 17:52:46 +0100 Subject: [PATCH] add type date to input --- script.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/script.js b/script.js index a85114b..2f3fc88 100644 --- a/script.js +++ b/script.js @@ -1,14 +1,17 @@ $(function() { $("#allRecord").on("click", ".editUser", function() { - $(this).toggleClass('fa-edit fa-check'); - $(this).toggleClass('editUser confirmEditUser'); - for(i=0; i<$("td", $(this).parent().parent()).length-1;i++) - { - j= $($("td", $(this).parent().parent())[i]); - j.html(''); - } + $(this).toggleClass('fa-edit fa-check'); + $(this).toggleClass('editUser confirmEditUser'); + 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(''); + } }); $("#allRecord").on("click", ".confirmEditUser", function() { function callBackVerif(data){