?
Solved

Form Collection

Posted on 1998-04-21
6
Medium Priority
?
240 Views
Last Modified: 2006-11-17
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.
0
Comment
Question by:jwilliams1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1426531
jwilliams1, can you explain it more?
0
 

Author Comment

by:jwilliams1
ID: 1426532
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.
0
 

Expert Comment

by:bwoods
ID: 1426533
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.
 
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Expert Comment

by:bwoods
ID: 1426534
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.
0
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 60 total points
ID: 1426535
jwilliams1,

You can check field content before creating the result page.

Example:

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

<table>
<%
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
%>
</table>


Best regards,
Bin Huwairib

0
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1426536
jwilliams1,

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

Thanks
Bin Huwairib
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question