Solved

Form Collection

Posted on 1998-04-21
6
233 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
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:bin_huwairib
Comment Utility
jwilliams1, can you explain it more?
0
 

Author Comment

by:jwilliams1
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Expert Comment

by:bwoods
Comment Utility
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 30 total points
Comment Utility
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
Comment Utility
jwilliams1,

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

Thanks
Bin Huwairib
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now