javascript - Disable changing of border-color with given class -



javascript - Disable changing of border-color with given class -

if add together "orange" before "orange" readonly. input have reddish borderline input read-only w/c wrong. dont want read-only input(supposedly database mark duplicate or have reddish borderline)

current output:

apple [read-only] orange // *added user* orange[read-only] //borderline changed reddish when button save clicked

wanted output:

apple [read-only] orange // *added user* , borderline changed reddish when button save clicked orange[read-only]

see fiddle demo , seek click add together row button before row "orange" value input field "orange" value of input.

$("#save").off("click").on("click",function(){ var existing = []; var duplicates = $('#mytable td:nth-child(3) input').filter(function() { var value = $(this).val(); if (existing.indexof(value) >= 0) { homecoming $(this); } existing.push(value); }); duplicates.closest('tr').css('background-color', 'red'); });

i tried :

duplicates.closest('#mytable td:nth-child(3) input:not(readonlytext)').css('background-color', 'red');

but nil change.

this bound happen per code. need differentiate between rows added user existing ones. can utilize readonly attribute rows added user , apply filter.

$("#save").off("click").on("click",function(){ var existing = []; $('#mytable td:nth-child(3) input').filter(function() { var value = $(this).val(); if ($(this).attr('readonly')) { existing.push(value); } }); var duplicates = $('#mytable td:nth-child(3) input').filter(function() { var value = $(this).val(); if (existing.indexof(value) > -1 && !$(this).attr('readonly')) { homecoming $(this); } }); duplicates.closest('tr').css('background-color', 'red'); });

javascript jquery html css

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -