title: Create variable number of buttons for an html form
body: <p>I'm trying to make some changes to a questionnaire. Currently on each page there is an html form which has 3 submit buttons with values "next", "back", and "home". The value of the button gets passed through to the java controlling everything so that it knows which page to load next.</p>
  
  <p>What I want to do is have a button along the bottom for each page in the questionnaire - however, this number varies between questionnaires.</p>
  
  <p>The total number of pages is passed through as $(totalNumber) by some freemarker code. I'm new to programming, so instinctively I want to write some kind of "for" loop in javascript that will create a new button each loop and increment a dummy variable to get the right number of buttons, but I can't work out how to do this (and I'm not sure if this is the right way of going about this!) </p>
  
  <p>Thanks for any help!</p>