Increase number of form inputs with js or php
I've created a script for a project using php and mysql to allow users to
create questions with multiple choice answers. By default I've set it so
that you can only have one question in your quiz but I am trying to add a
button that when clicked you can add new input box's in order to add more
questions to your quiz. I thought I should do this in javascript because
it is client side and therefor wont alter what is already entered in the
previous input boxes? I tried a for loop with a counter and increment the
counter on click but this doesn't seem to work because I think the page
needs to refresh. I don't mind if the solution is in php or javascript.
var limit = 1;
function addQuestion(){
limit++;
}
for(var i=1; i <= limit; i++)...
No comments:
Post a Comment