Form Collection

I have form that collects information and sends it to database using ASP.  

I am submitting a form and I want to show the student what he/she submitted.

I used:
 = Request.form("Name")

My form has some fields (combo boxes) that will never be filled out at the same time, so how do I make the form submit only those results that are filled in?
You help is greatly appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jwilliams1, can you explain it more?
jwilliams1Author Commented:
I want to make a results page that only returns those results that are entered on the form, so that the student has an account of what he/she entered.
Keep up with which combo boxes are changed.  It's personal choice what type of variables, etc. to use to do this.  One possible way is to use an array with one element for each combo box to hold flags for whether the matching combo box is changed or not.

'for example
'**at form module level or public in a common module
private m_ChangedArray(1 to however_many_comboboxes_you've_got) as boolean
  Then, add code to the combo box events (I would have made these combo boxes an array, and used defined constants to determine which combo box was being accessed. You can do it with individually named combo boxes, but you will have lots of duplicate code, as you will have to put code in every combobox's events).  The events that you will want to monitor are ComboBox_Changed and/or ComboBox_LostFocus.  I usually just do lost focus, as I have found the combobox's Changed event to be a little flaky.  When it loses focus, check to see if they changed it.  If so, m_ChangedArray(Index_that_corresponds_to_this_CB) = true.
  Later, when they hit the SUBMIT button or whatever action you have supplied, check the m_ChangedArray values and only send data from the comboBoxes that have changed.

Like Bin_Huwairib, I'm not sure if this is what you are asking, so this may or may not be what you need.  If it guides you to a solution, let me know and I'll lock it. Otherwise, please clarify further.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

PS  Another answer, if they will NEVER fill out more than one combo box at a time, is to put an array of option buttons on the form, one above each combo box.  When they select the option button above a combo box, enable it and disable the others.  In order to use a combo box, they have to "Turn it on".  When the action occurs that signals it's time to submit, check and see which option button is selected, and only send the data from its matching combobox.

You can check field content before creating the result page.


Suppose that you have two text fields the first on called "Name" and the other one called "Address" and one combo box called "State".

if request(“Name”)<>”” Then
 response.write(“<td> Name : “ & request(“Name”) & “ </td>”)
end if
if request(“Address”)<>”” Then
response.write(“<td> Address : “ & request(“Address”) & “ </td>”)
end if
if request(“State”)<>”” Then
response.write(“<td> State : “ & request(“State”) & “ </td>”)
end if

Best regards,
Bin Huwairib


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

Please correct the lines that contain the tag <td> to
response.write("<tr><td> ... </td></tr>”)

Bin Huwairib
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.