From a website web page. there's an input text field (policynum) and a call button (policynum). I created a function (getEntity) that renders an XML response. From the XML response, the goal is to parse out data from tag . I created a second function (getEntity1), but the button doesn't respond. Note: I remember to change onclick function name.; see code below:
<input id="policynum" name="policynum" type="text" value="">
<button id="policynum" class="btnSize" onclick="getEntity()">GET ENTITY ID</button>
function getEntity() {
location.href='https://chwebsrvr.blserviceinc.com/ETM/admin/setup/context/ConceptOne/'+ document.getElementById('policynum').value+'/ConceptOne';
}
XML Response below with tag data
<ContextGet Reply_Code="1" Process_Status="PRC" Process_Message="Transaction
successfully processed." View="full">
<Context System_Code="ConceptOne" Login_Name="CICFL000003-00"
App_Code="ConceptOne">
<Context_Name>ETM Policy Holder</Context_Name>
<Context_Config>
<![CDATA[
<ConceptOne>
<Entity_ID>86100</Entity_ID>
<Role_Type>CN</Role_Type>
<Team_Role>AGTBND</Team_Role>
</ConceptOne>
]]>
</Context_Config>
</Context>
</ContextGet>
This function will replace geetEntity function to return data to the screen from Entity_ID tag:
function getEntity1() {
XmlDocument xml = new XmlDocument();
xml.LoadXml(myXmlString);
XmlNodeList xnList = xml.SelectNodes("//ConceptOne");
foreach (XmlNode xn in xnList)
{
XmlNode example = null;
string na = "";
example = xn.SelectSingleNode("Entity_ID");
if (example != null)
{
na = example.InnerText;
}
}
$response = $client->request('GET',
'https://chwebsrvr.blserviceinc.com/ETM/admin/setup/context/ConceptOne/'+
document.getElementById('policynum').value+'/ConceptOne');
$response = $response->getBody()->getContents();
}
Suggestion please...