I need to check against dropdownlist.text unique Identifer if exist insert identifier in table2 with rest of data
I have a web form with a dropdownlist box that is populated with one table(table1). but other fields on the form is from another table(table2). I need when a user click to save input data. The save click to check against the dropdown list and add the unique identifier number that was assign to the chosen item and not the text showing in the dropdownlist box from table1 to be added to table2 fk field. That I created, is this possible. If so can I have example code
example:
table1 column1 pk clientID = unique identify 34
column2 owners = franklin = 34
table1 column1 pk clientID = unique identify 35
column2 owners poston 35 =
table1 column1 pk clientID = unique identify 36
column2 owners = sara = 36
table2 column1 pk MemberID
table2 column2 fk clientID
table2 column3 cars
table2 column4 houses
table2 column5 jets
form design:
dropdownlist box is populate with owners
input.textbx1 cars
input.textbx2 houses
input.textbx3 jets
ok...
if dropdownlist box selection is franklin
textbx1 entry 5 cars
textbx2 entry 5 houses
textbx3 entry 1 jet
on click of save
if (dropdownlist.text = "") { error message } else if
(dropdownlistbox.text = "franklin") { search database for franklin then
locate franklin unique identifier insert that unique identifier into table2 fk
clientid and insert the rest of the information from the web form input field
into table2 } if (dropdownlistbox.text = "poston") { search database
for poston then locate poston unique identifierinsert that unique identifier
into table2 fk clientid and insert the rest of the information from the web form
input field into table2 } if (dropdownlistbox.text =
"sara") { search database for sara then locate sara unique
identifierinsert that unique identifier into table2 fk clientid and insert the
rest of the information from the web form input field into table2 } if(
dropdownlist.text = "any text in the dropdownlist") { search database for
dropdownlistbox.text then locate dropdownlistbox.text unique identifierinsert
that unique identifier into table2 fk clientid and insert the rest of the
information from the web form input field into table2 }
|