Hi,

I am working on creating application forms for our website and I face some difficulties. Here is the deal;

I am using ASP:Wizard and I have 4 wizards for a form. Wizard 2 contains 3 similar tables each having details about the applicants 3 past addresses. For example; If an applicant lived at 3 different location, he/she would provide 3 addresses each having street, apt#, state, zip, etc. And each of these attributes gets a column in the database and are stored in a single table called tblAddress. So, tblAddress will have 3 records for applicant# 29 if he lived in 3 locations.

I don't know how to deal with this in ASP.NET. If textboxes for address1 are named street1, apt#1, state1, zip1, etc what would be the name for textboxes for address2 and how would these two or more addresses be saved into the same table... Do I have to use a loop with the ASP code to accept these similar values? or have to accept them seperately and trigger individual address update into the database?

I am novice to ASP.NET and this might be a silly thing but its kinda big for me :)

Thanks,

There are several approaches:

FIRST APPROACH
1) Have a page to select an applicant.
2) When the user selects the applicant, a page comes up showing the details of the applicant.
3) On that page, have a link to a page where a user can add an address for the applicant.
4) When the user clicks on the link, a form appears asking for the address information.
5) When the user clicks submit, the data is saved into the database and the user is taken to the applicant information page.
6) To add another address, the user clicks on the add address link again.

For multiple addresses, the user will be required to keep going back to the add address form for each address.

SECOND APPROACH
On the add address form, show three address blocks e.g. street1, city1, state1, zip1, street2, city2, state2, zip2, street3, city3, state3, zip3

When the user clicks submit, the ASP first adds a record to the database and records the information for the first address. It then adds a second record and records the information for the second address. Lastly, it takes adds a third record and records the information for the third address.

THIRD APPROACH
1) Ask the user for how many address to add.
2) Have ASP loop through the number of times the user specified. Keep the iteration count of the loop in a variable called Count.
3) At each iteration, have ASP create fields in the form called streetCount, cityCount, stateCount and zipCount where Count is the current loop iteration. This would result in something very similar to the second approach; however, this is dynamically generated based on the user's input.
4) When the user clicks submit, have ASP do another loop, but instead of creating the form, it will create a new database record, pull the information from streetCount, cityCount, stateCount and zipCount and record those values into the new record.

The first approach is the easiest to program, but most time consuming for the user. The last approach is probably the hardest to program, but a lot faster for the user. The second approach is a middle ground between the two.

I really appreciate your reply and thank you so much.
This would help me in choosing the best way to provide the user with best interface.

Now, how do I deal with it if my focus was on applicant. Meaning; If the applicant lived at 3 different locations, how would I accept these different addresses and store them into a single table? I am talking about the aspx/aspx.vb page where I could use some code to accept these different addresses using a loop and trigger a stored procedure to save them in a single table with 3 iterations.

I hope I make sense to you.

Thanks and looking forward for replies...

Cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.