Created
April 5, 2011 19:10
-
-
Save chronossc/904292 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(function(){ | |
$("input[type!=hidden]").each(function(i,obj) { | |
//console.debug(i,obj) | |
if ($(obj).attr('id').slice(0,8) == "id_form2") { | |
hidden_name = $(obj).attr('name').replace('2','1') | |
obj_hidden = $("input[name="+hidden_name+"]") // so we get form 1 value field | |
$(obj).change(function(e) { | |
if ($(this).attr('val') != $(obj_hidden).attr('val')) { | |
$(this).parents("tr:first").addClass('forced'); | |
} else { | |
$(this).parents("tr:first").removeClass('forced'); | |
} | |
}) | |
$(obj).change() | |
} | |
}) | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment