I am setting up a page to copy values from an existing record and paste them into a new record to save the user filling out a lengthy form with similar information.
I have successfully been able to retrieve values and paste them into the fields for the text boxes. I am struggling with being able to get my drop down lists to change their values to match the copied record.
The drop down lists get their values from a look up table within the database.
The JS code I am using is:
$.ajax({
type: "POST",
url: "WSHardware.asmx/GetHardware",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var jhardwareitems = response.d;
$('#HardwareDetails').empty();$.each(jhardwareitems, function (index, jhardware) {
//Populating TextBoxes in InsertItemTemplate
$('input[id$=HWNameTextBox]').val(jhardware.HardwareName);$('input[id$=ModelNoTextBox]').val(jhardware.ModelNo);$('dropdown.options[id$=DropDownList_Kit]').val(jhardware.KitID); //<-- CANT GET THIS TO CHANGE VALUE IN MY DROPDOWNLIST
// Shortened for clarityAny ideas?