im working on a project right now that has a form that needs to be filled out by applicants. Applicants also can go back later once the form has been submitted and edit the form if changes need to be made. My problem lies in the fact that i dont want to duplicate the web page for the two different cases of the form being empty and the form being filled with the pre-existing info in the database.
Im using ASP and am having no problem checking whether or not the record exists and getting the necessary info to fill the form. However, im not sure how to correctly place the values in the form.
Normally I would have a Javascript function with a bunch of:
FormName.FieldName.value = "valuefrom database";
But the problem is the fieldnames and number of fields need to be dynamic because the database is changing constantly. The form itself adjusts to the changes in the database already so that part is fine.
Here is the basic idea of what im looking to do but i have no idea how to actually do it! below clearly does not work!
Expand|Select|Wrap|Line Numbers
- function updateform(fieldname,DBvalue){
- FormName.fieldname.value = DBValue;
- }
Thanks!!