// JavaScript Document $(document).ready(function() { var counter = 1; var editid; $(".fail-footer-comment").click(function() { editid = $(this).attr("name"); if($("#"+editid+"").css("display") == "block") { $("#"+editid+"").css("display", "none"); } else { $("#"+editid+"").css("display", "block"); } }); //var counter = 1; $("#hideZitat").click(function () { document.getElementById('addButton').style.display = 'none'; document.getElementById('removeButton').style.display = 'none'; document.getElementById('hideZitat').style.display = 'none'; document.getElementById('TextBoxesGroup').style.display = 'none'; document.getElementById('uploadBild').style.display = 'block'; document.getElementById('showZitat').style.display = 'block'; } ); $("#showZitat").click(function () { document.getElementById('addButton').style.display = 'block'; document.getElementById('removeButton').style.display = 'block'; document.getElementById('hideZitat').style.display = 'block'; document.getElementById('TextBoxesGroup').style.display = 'block'; document.getElementById('uploadBild').style.display = 'none'; document.getElementById('showZitat').style.display = 'none'; } ); $("#addButton").click(function () { if(counter>25) { //alert("Only 25 textboxes allow"); return false; } var newTextBoxDiv = $(document.createElement('div')) .attr("id", 'TextBoxDiv' + counter); newTextBoxDiv.after().html('
'); newTextBoxDiv.appendTo("#TextBoxesGroup"); counter++; }); $("#removeButton").click(function () { var counterx = counter - 1; if(counterx==0) { //alert("No more textbox to remove"); return false; } counter--; $("#TextBoxDiv" + counter).remove(); }); })