help with passing form data

    Date: 10/02/06 (Web Development)    Keywords: database, asp

    I am currently working in ASP, but this might also be an issue with other types of server-side scripting, so if anyone has suggestions in another language, feel free to let me know!

    Currently, I have several forms and I'm trying to consolidate/condense the way the form data is handled and written to a database. I like the idea of using a for...next loop to loop through the form fields instead of multiple 'request.form' statements in order to display the form field values on a confirmation page (before submitting to the db).

    The code I'm using is similar to this:

    For each inputField in Request.Form
    For each inputValue in Request.Form(inputField)
    response.write inputField & " = " & inputValue & "
    "
    Next
    Next

    However, I'm encountering a couple of issues:

    1. The output seems to appear in a completely random order, which isn't very user friendly. e.g. in the form the order might be: name, address, telephone, comments; but the loop output shows it as: name, comments, telephone, address (or something similarly random). the values are all displayed, just in the wrong order.

    2. While looping through the form eliminates the need to grab each form field value individually, there are some form field values that I DON'T want displayed on the confirmation screen. Is there any way to set this up without a lot of extraneous 'if' statements?

    I thought maybe I need to add the form field values in an array, but I'm not even sure if that is at all useful, i.e. how do I manipulate them afterwards?

    Thanks for any help.

    Source: http://community.livejournal.com/webdev/357805.html

« Alignment problems || IE7 and Multiple IE Versions »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home