address field. js and style is broken

This commit is contained in:
Matthew K. Fu JuYuan authored and chris committed 2012-11-20 09:53:36 +08:00
1 parent be448d42c9
commit a85e5fcc0d
14 files changed
+386 -311

No files matched your search

@@ -0,0 +1,26 @@
function checkMultipleInput() {
$(".multipleInput").each(function() {
$(this).children('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
});
}
function removeInput(){
$(".removeInput").click(function (){
$(this).parents(".controls").remove();
checkMultipleInput();
return false;
});
}
$(document).ready(function(){
var $modalNumber = 0;
checkMultipleInput();
removeInput();
$(".addinput").click(function (){
$modalNumber+=1;
var $CloneTarget = $(this).parents(".controls").prev(".multipleInput").children('.controls:last');
$(this).parents(".controls").prev(".multipleInput").append($CloneTarget.clone());
$(this).parents(".controls").prev(".multipleInput").children('.controls:last input').val("");
removeInput();
checkMultipleInput();
return false;
})
});