Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Calculate product in form

Posted by: Sickstigma Apr 26 2024, 10:53 AM

Is it possible, within the following code, to calculate the product of "COGS" divided by "Revenue" in "COGS%"?
[ <FormField>
<Styles cellColor="Black" colorCodeUsage="0" imageCodeUsage="1" colSeqNum="1" colSpan="2" dataType="15" dataTypeName="Currency" hasColor="0" hasImage="0" hideIfEmpty="0" isSearchable="0" printOnly="0" labelColor="Black" rowSeqNum="32"/>
<Name>Revenue</Name>
</FormField>
<FormField>
<Styles colorCodeUsage="0" imageCodeUsage="1" colSeqNum="2" colSpan="1" dataType="15" dataTypeName="Currency" hasColor="0" hasImage="0" hideIfEmpty="0" isSearchable="0" printOnly="0" rowSeqNum="32"/>
<Name>COGS</Name>
</FormField>
<FormField>
<Styles colorCodeUsage="0" imageCodeUsage="1" colSeqNum="3" colSpan="1" dataType="2" dataTypeName="Number" hasColor="0" hasImage="0" hideIfEmpty="0" isSearchable="0" printOnly="0" rowSeqNum="32"/>
<Name>COGS %</Name>]

Posted by: Christian J Apr 26 2024, 01:51 PM

What is that code, React?

Posted by: Sickstigma Apr 26 2024, 03:50 PM

XML

Posted by: Christian J Apr 26 2024, 03:57 PM

XML can't do any calculations by itself, it's just a markup language.

Posted by: Sickstigma Apr 26 2024, 06:33 PM

Is there a compatible language that can do calculations?
And, hey!!
Thank you for helping!!
Sick

Posted by: Christian J Apr 26 2024, 07:53 PM

Javascript or (better) a server-side scripting language (like PHP) might do it. Not sure how to use these with XML, but perhaps these pages can be helpful:
https://developer.mozilla.org/en-US/docs/Web/XML/Parsing_and_serializing_XML
https://www.php.net/manual/en/book.xml.php

How do you currently transform the XML data into a web page?

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)