ITsolutionWizard
asked on
jquery, fill in option value
Inside of jquery - id = 'listMe', how can i get Amount element fill up the <select id='listMe'>?
<Amount PrefillValue="No" Min="10000" Max="20000" Year="1"></Amount>
<Amount PrefillValue="No" Min="20000" Max="30000" Year="1"></Amount>
<Amount PrefillValue="No" Min="10000" Max="20000" Year="1"></Amount>
<Amount PrefillValue="No" Min="20000" Max="30000" Year="1"></Amount>
function parseSelectXMLBondAmountList(xml, selectid, bondState, bondName) {
var html = "";
$('#' + selectid).prop("disabled", false);
$(xml).find('Bond').each(function (i, e) {
{
if (bondState == $(e).find('GeneralInformation').find('State').text() && bondName == $(e).find('GeneralInformation').find('Name').text())
{
var selectedBondName = $(e).find('GeneralInformation').find('Name').text();
var coverageType = $(e).find('Coverage').attr('Type');
var AmountMax = $(e).find('Amount').attr('Max');
var AmountMin = $(e).find('Amount').attr('Min');
html += selectedBondName + " " + coverageType + " " + AmountMax + " " + AmountMin;
if (coverageType == "list") {
$('#bondAmountPlaceHolder').html("<select id='listMe' class='select2'></select>");
}
else {
$('#bondAmountPlaceHolder').append("<input type='text' id='bondAmount2' name='bondAmount2' value='" + AmountMax + " />");
}
}
}
});
//alert(html);
}
<Surety>
<SuretyLine>
<Commercial>
<Bond>
<GeneralInformation UI="BondInfo">
<Name ID="bondName" PrefillValue="Yes">DMV Traffic Violators School Classroom</Name>
<State ID="bondState" PrefillValue="Yes">CA</State>
</GeneralInformation>
<Coverage Type="List">
<Amount PrefillValue="No" Min="10000" Max="10000" Year="1">10000</Amount>
</Coverage>
</Bond>
<Bond>
<GeneralInformation UI="BondInfo">
<Name ID="bondName" PrefillValue="Yes">DMV Traffsdfasdfads</Name>
<State ID="bondState" PrefillValue="Yes">CA</State>
</GeneralInformation>
<Coverage Type="List">
<Amount PrefillValue="No" Min="10000" Max="20000" Year="1"></Amount>
<Amount PrefillValue="No" Min="20000" Max="30000" Year="1"></Amount>
</Coverage>
</Bond>
</Commercial>
</SuretyLine>
</Surety>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Any helps?
that is different one. I tried yours from another questions. and the <amount> does not loop and I see same amount all the times.If it does not work for you then respond in the relevant thread and state that it does not work showing your result.
Please can we resolve one issue at a time - I believe this question is similar enough to your other question that answering one will answer both. I would prefer to remain in one thread until it is closed.
Lets get the other question solved and if you still have questions we can come back to this thread.
ASKER
It is ok ... let other to help if you can't
Ok - post back here if you don't get any follow ups.
ASKER
No follow up
ASKER
I just do not know how to extract the <amount> in loop.