I need Java script to add more items to the question but I would like each item to be text entry. If possible, I would like a small “Add Name” button above the items. Can someone help me with this?
Solved
Pick Group Rank, Java to add more items
Best answer by Tom_1842
Looks like I included the OnReady close bracket in the above. Sorry about that! Try using the below:
var that=this.questionId;
jQuery("#"+this.questionId+" tr.ChoiceRow:not(:eq(0))").hide();
jQuery("<input type='button' id='add' value='Add Name' name='+' />").insertAfter("#"+this.questionId+" tr.ChoiceRow:last");
jQuery("#add").on('click',function(){
var c= jQuery("tr.ChoiceRow:visible").length;
jQuery("#"+that+" tr.ChoiceRow:eq("+c+")").show();
});
jQuery("<input type='button' id='minus' value='Remove Name' name='-' />").insertAfter("#add");
jQuery("#minus").on('click',function(){
var d= jQuery("tr.ChoiceRow:visible").length;
d -= 1;
jQuery("#"+that+" tr.ChoiceRow:eq("+d+")").hide();
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
