diff --git a/index.html b/index.html index 708d752..c28d914 100644 --- a/index.html +++ b/index.html @@ -20,12 +20,18 @@ valueselector:"No, ¿Por que?", }); + $("#id_cencontrabajo").mutarSelect({ + valueselector:"¿Otra forma, Cual?", + }); - $("id_cencontrabajo").mutarSelect({ + $("#id_arealaboral").mutarSelect({ valueselector:"¿Otra forma, Cual?", }); - - + + $("#id_dedicacionem").mutarSelect({ + valueselector:"¿Otra, Cual?", + }); + }); @@ -84,7 +90,7 @@ - @@ -94,13 +100,11 @@ - - + diff --git a/js/jquery.mutable.js b/js/jquery.mutable.js index 4ebfc13..450cc5a 100644 --- a/js/jquery.mutable.js +++ b/js/jquery.mutable.js @@ -7,22 +7,18 @@ valueselector:"Agregar nuevo", }, options ); - var selector = this; - selector.append(""); + var father = $(this).attr("id"); + $(this).append(""); - $(".mutarselect-add").click(function( event ){ + $("#" + father + " .mutarselect-add").click(function( event ){ event.preventDefault(); - - //alert($(this).parent(".mutarselect").attr("id")); - var father = $(this).parent(selector).attr("id"); - //var positionReal = $(this).parent(".mutarselect").offset(); - // + $("#" + father + " .mutarselect-rm" ).remove(); - - $(this).parent(".mutarselect").hide(); - $("").insertAfter( $($(this).parent(".mutarselect")) ); + $(this).parent("#" + father).hide(); + + $("").insertAfter( $(this).parent(".mutarselect") ); + }); - $("form").on("keypress", ".mutarselect-input",function( event ){ if ( event.keyCode == '13' ){