Click to See Complete Forum and Search --> : ComboBox
KLynch0803
01-20-2010, 06:36 PM
Im new at ASP so any detailed hep would be appreciated. I have been a intermediate user of Access and minor VB in Access and trying to make the switch to asp for web page applications versus Access.
I have a problem I can't figure out and I know its just so simple. I want to take a ComboBox named "Combo1" and it contains 900 values. I have this box set to allow multiple selections on my form as well. I want an "Update Services" button on my page that will take the values from "Combo1" and insert them into "TextAreaField1" on the form. I know its contains something like this but not sure of everything that need to be done.
<%
'Detect Button
if Request.Form("Update Services") <> "" then
DetectedButton = Request.Form("Update_Services")
end if
%>
<%
if DetectedEditButton <> "Update Services" then
'Insert selected items from combobox "Services" into
'Textbox "Serviceprovidedupdate"
request.form([TextAreaField1]) = request.form([combo1])
end if
%>
KLynch0803
01-20-2010, 06:39 PM
I do not have edit permissions yet to my posts but I failed to mention if I select more than one item from the Combo I want each value added to "TextArea1" seperated by ","
Thanks again for help
yamaharuss
01-21-2010, 03:06 PM
Where does the value "Update Services" come from???
KLynch0803
01-21-2010, 03:13 PM
Where does the value "Update Services" come from???
The Update Services is a shown in the code the detect button sequence. I'm actually updating a services field. I replaced them with combo1 and textArea1 so that it would be easier to show what type of fields I was using.
My goal is to use a combobox with 900 options that could be selected at random (more than one or just one at a time). When I hit button with label "Update Service" it would take the values selected in Combobox1 and insert them into textarea1 seperated by comma's.
Both fields reside on the same form..
yamaharuss
01-21-2010, 03:14 PM
Post your form, I want to see where your form field Update_Services has a value of "Update Services" and why you are using <>
KLynch0803
01-21-2010, 03:21 PM
Post your form, I want to see where your form field Update_Services has a value of "Update Services" and why you are using <>
<input type="submit" value="Update Services" name="Update_Services"></td>
</tr>
yamaharuss
01-21-2010, 03:23 PM
so shouldn't this:
if DetectedEditButton <> "Update Services" then
be this:
if DetectedEditButton = "Update Services" then
KLynch0803
01-21-2010, 03:29 PM
so shouldn't this:
if DetectedEditButton <> "Update Services" then
be this:
if DetectedEditButton = "Update Services" then
Well you would think so but there is actually 8 buttons on the page or so.. So I did a sequence like this at the top of the page.. So if you select othing then it will show all records from tbl
<%
'Declare Session Variables to preserve the current page state
'Session("ApprovalType")
'Session("ServiceType")
'Session("0") thru Session("19") used to update a record this preserves the data to use later
'Declare counter varibles
dim x
'Delcare array to build buttons in listview
dim RsArray(3)
'Declare array to hold one record
dim RsRecordArray(20)
'Declare MDB varibles to use
dim rs
dim sql
dim testsql
testsql = "Test Message"
'Declare Counter Varibles to use with if, for loops
dim i
'Declare our button variables
dim DetectedButton
dim DetectedEditButton
'Declare variables to detect which edit button was clicked
dim RecordButton
'Ok lets detect which button was clicked
if Request.Form("ApprovedStatus") <> "" then
DetectedButton = Request.Form("ApprovedStatus")
'Save it in a session variable to use later, in case page is refreshed
Session("ApprovedorNot") = Request.Form("ApprovedorNot")
end if
if Request.Form("Provider_Service_Type") <> "" then
DetectedButton = Request.Form("Provider_Service_Type")
'Save it in a session variable to use later, in case page is refreshed
Session("ServiceType") = Request.Form("ServiceType")
end if
if Request.Form("Provider_Coverage_Area") <> "" then
DetectedButton = Request.Form("Provider_Coverage_Area")
'Save it in a session variable to use later, in case page is refreshed
Session("CoverageArea") = Request.Form("CoverageArea")
end if
if Request.Form("Provider_Name") <> "" then
DetectedButton = Request.Form("Provider_Name")
'Save it in a session variable to use later, in case page is refreshed
Session("ServiceCompanyName") = Request.Form("ServiceCompanyName")
end if
if Request.Form("Provider_Based_Approval_Service_Coverage") <> "" then
DetectedButton = Request.Form("Provider_Based_Approval_Service_Coverage")
end if
if Request.Form("Edit") <> "" then
DetectedEditButton = Request.Form("Edit")
'Now split the button value into 3 parts
RecordButton = Split(DetectedEditButton," ")
'RecordButton(2) now contains the record of the database we want to edit
Session("RsRecordNumber") = RecordButton(2)
end if
if request.form("Update Services") <> "" then
DetectedEditButton = Request.Form("Update_Services")
end if
if Request.Form("UpDate") <> "" then
'Prep the database to be accessed
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/mydbpath.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
Session("0")=8
and another 1189 lines of code follows..