It is very common in business scenario where we need to copy the content of one field to another, highlighting field , set focus on field, validations of fields, mathematical calculations to calculate subtotal and grandtotal. To achieve all these functionality we need to use either Java script or Form Calc which is completely integrated into the Adobe Livecycle Designer.
In this blog I will try to cover some of the most common scenario where we need to write either Java Script or Form Calc in Adobe Form.
Highlighting the boundary of field and focusing the cursor on that field if the field is empty using Java script.
Here we will check the value of the field if it is empty we will color the boundary of the field and also focus the cursor on that field.
When user click on the button it will check all the fields on the form, if any of the field is empty then java script will color the boundary and set the focus on that field.
Below is the script snippet by which we can achieve this functionality.
Calculating the Net Price and Total Price on Calculate event using Form Calc.
Here we will calculate the Net price of single product and Total price of products purchased by user on Calculate event using Form Calc. Here both Net Price and Total Price fields are in ‘Display Mode’.
When user enter the Price/Unit and Quantity values the Form Calc Script automatically calculate the Net Price and Total Price. Below Image Demonstrate the Same.
To achieve the above functionality put the below code inside the calculate event of respective field.
Form Calc Script to calculate the Net Price:
Form Calc Script to calculate the Total Price:
So, in this way we can say that Java script and Form calc are an important part of an Adobe Interactive Form to achieve different business functionality.
In case you need assistance on SAP Support Services, please contact us. Please send us your questions, comments or assistance request and our team would be glad to assist you.
By Gopichand Panghate (on behalf of SAP Consulting Team)
SAP :: Streamlined
We offer variety of services including SAP ECC ,SAP HR,SAP BW,SAP CRM, SAP SCM,SAP BPM, Business Objects, SAP ABAP Development, SAP BASIS and SAP NetWeaver consulting. We have expertise in providing implementation,development, SAP Migration and SAP support services to SAP customers across diverse industries at a global level.
Have a question on SAP? Write to our SAP Architect : AskTheArchitect@Apprisia.com
(We promise a no-obligation consulting reply)