October 2nd, 2011, 10:36 PM
Is reusablity applicable in html forms?
what would be the best way to avoid duplicate code in html forms?
e.g. a students application form to a school. it would have different sections like personal info, address, hobbies.
ON ONE VERSION OF THE APPLICATION FORM.
a single page should contain everything, all the sections.
ON THE SECOND VERSION,
it should be like a wizard type of data input. so each section would have each a separate page.
now my concern is, is it possible to avoid repetition of code in this situation? in case I have to implement both of the types of application forms, there is definitely repetition because I have to write code for the wizard type and the one page application form. AND ANOTHER PROBLEM, if the maxlength of an input field changes, then I have to change both of the input fields that would change from the wizard type and the 1 page application form.
how can this be addressed? how can I get out of this maintenance nightmare?
suggestions would be very much appreciated.
October 2nd, 2011, 10:47 PM
The easy way to do this is to write each piece of the form in a seperate file and include the section/sections that you need for each process. In the wizard you'll include one file each time, and in the full form you'll include all of them.
Comments on this post
October 2nd, 2011, 11:54 PM
thanks for the tip. , I get to think too much I forget about the basic stuff.
again, thank you.
October 3rd, 2011, 12:32 AM
by the way, is this possible to do with just pure html? without using jsp,asp or php?
October 3rd, 2011, 08:55 AM
October 3rd, 2011, 10:03 PM
well that is a concise answer, anyway thanks
Originally Posted by E-Oreo
and how do you do the third attempt on that flash drive?
November 7th, 2011, 01:29 AM
Well for create different files and include it is the right option for that but it is not possible to do with pure HTML, you have to use any other server side scripting language like PHP, ASP