I'm new to Info Path so forgive me for the simplicity of this question. But
I'm modifying the Expense Report template and have added a few more fileds of
my own. Now I'm trying to compare two fileds to see which has the lowest
value and take that and do some calculations with it; see below! Except what
happens is that it never picks up the right value. Here I'm looking for the
lowest value, if I enter 100 for USAIDLodgingPerDiem and enter 50 for
ActualHotelCostPerNight it always takes the 100. Now enter a lower value than
100 and it works just fine! PUZZELED!!
Any assistance would be greatly appreicated.
Aria
/*
function TravelLodgeCost()
{
var USAIDLodgingPerDiem =
XDocument.DOM.selectSingleNode("//my:USAIDLodgingPerDiem");
var ActualHotelCostPerNight =
XDocument.DOM.selectSingleNode("//my:ActualHotelCostPerNight");
var NumberOfNights = XDocument.DOM.selectSingleNode("//my:NumberOfNights");
var LodgingCalculation =
XDocument.DOM.selectSingleNode("//my:LodgingCalculation");
if (USAIDLodgingPerDiem.nodeTypedValue >=
ActualHotelCostPerNight.nodeTypedVlaue){
XDocument.UI.Alert(USAIDLodgingPerDiem.nodeTypedValue);
setRoundedValue(LodgingCalculation,
getNodeTypedValue(ActualHotelCostPerNight,0,true) *
getNodeTypedValue(NumberOfNights,0,true));
}else{
XDocument.UI.Alert(USAIDLodgingPerDiem.nodeTypedValue);
setRoundedValue(LodgingCalculation,
getNodeTypedValue(USAIDLodgingPerDiem,0,true) *
getNodeTypedValue(NumberOfNights,0,true));
}
}
*/
S.Y.M. Wong-A-Ton - 06 Apr 2006 13:58 GMT
You may want to fix the typo in your code first and then try it again.
"ActualHotelCostPerNight.nodeTypedVlaue" should be
"ActualHotelCostPerNight.nodeTypedValue". It might make a difference...
---
S.Y.M. Wong-A-Ton
> I'm new to Info Path so forgive me for the simplicity of this question. But
> I'm modifying the Expense Report template and have added a few more fileds of
[quoted text clipped - 34 lines]
> }
> */
Aria1844@hotmail.com - 07 Apr 2006 14:23 GMT
That wasn't the issue! Any other suggestions?
> You may want to fix the typo in your code first and then try it again.
> "ActualHotelCostPerNight.nodeTypedVlaue" should be
[quoted text clipped - 40 lines]
> > }
> > */