function fnGetBondNameList(bondState) {
$.ajax({
url: "http://localhost:5489/BondList.xml",
success: function (xml) {
parseSelectXML(xml,"bondName","Bond",bondState);
},
error: function (xhr, ajaxOptions, thrownError) {
alert("Status: " + xhr.status);
alert("Error: " + thrownError);
}
});
}
function parseSelectXML(xml, selectid, xmlnode, bondState) {
var selecthtml = "", selectBondName="";
var i = 0;
$(xml).find(xmlnode).each(function () {
if (bondState == $(this).find('GeneralInformation').find('State').text()) {
selectBondName = $(this).find('GeneralInformation').find('Name').text();
selecthtml += '<option value="' + selectBondName + '">' + selectBondName + "(" + bondState + ") " + '</option>';
i = i + 1;
// alert(selecthtml);
}
});
$("#" + selectid).prop("disabled", false);
$('#' + selectid).html(selecthtml).val(selectBondName);
//modal information
$('#' + "bondListFilterByState").html(selecthtml).val(selectBondName);
$('#' + "bondlistFilterByState_selectedBondName").html(selectBondName).val;
$('#' + "bondlistFilterByState_selectedState").html(bondState).val;
//modal end information
}
<select class="select2"
id="bondState"
name="bondState"
onchange="fnSaveSingleData(this.name, '0'); fnGetBondNameList(this.options[this.selectedIndex].value);"
data-placeholder="Choose Bond State...">
<option value=""></option>
@foreach (var item in Model.stateList)
{
<option value=@item>@item</option>
}
</select>
<select data-placeholder="Choose Bond.." class="select2" disabled required onchange="fnSaveSingleData(this.name,'0');" id="bondName" name="bondName">
<option value=""></option>
</select>
<Surety>
<SuretyLine>
<Commercial>
<Bond>
<GeneralInformation UI="BondInfo">
<Name ID="bondName" PrefillValue="Yes">Contractor 1</Name>
<State ID="bondState" PrefillValue="Yes">CA</State>
</GeneralInformation>
<Image></Image>
<Status>Online</Status>
</Bond>
<Bond>
<GeneralInformation UI="BondInfo">
<Name ID="bondName" PrefillValue="Yes">Contractor 2</Name>
<State ID="bondState" PrefillValue="Yes">CA</State>
</GeneralInformation>
<Image></Image>
<Status>Online</Status>
</Bond>
<Bond>
<GeneralInformation UI="BondInfo">
<Name ID="bondName" PrefillValue="Yes">Contractor asdfasd</Name>
<State ID="bondState" PrefillValue="Yes">FL</State>
</GeneralInformation>
<Image></Image>
<Status>Online</Status>
</Bond>
</Commercial>
</SuretyLine>
</Surety>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE