Using combo box and list box

This walkthrough demonstrates how to use combo box and list box to create a simple order form. It also shows how to use document level JavaScript.

The files used in this walkthrough can be downloaded here: OrderForm.docand OrderForm.pdf.

  1. Launch Microsoft Word. Type necessary texts. Choose CenoPDF > Add Combo Box. Click the Options tab. Type Motherboard in the Item box and 80.00 in the Export Value box. Click the Add button. This defines the price of the motherboard is $80.

  2. Add more items into above box:

    Pentium 4 => 100.00; AMD CPU => 90.00; CD-ROM => 20.00; Keyboard => 10.00; Mouse => 12.00

  3. Follow the same way as above, choose CenoPDF> Add List Box to add a list box named shipping and add a few items to it.

  4. Add a text box named total and make it read-only.

  5. Choose CenoPDF > Document Settings > Document Level JavaScript tab. Click the Add button.

    function calculateTotal()
    {
        getField("total").value = getField("computerparts").value + getField("shipping").value;
    }

  6. Go to the properties box of the combo box and list box. Click the Actions tab. Click the OnBlur trigger and the Add button to add a JavaScript action with the following script:

    calculateTotal();

  7. The final document looks like this:

  8. Choose CenoPDF > Export to PDF to generate the final PDF file and open it in Adobe Reader.