How can I use a checkbox that alters a field value in Writer?

I’m trying to create a quotation template in Writer. The idea is loosely the following:

  1. Have a checkbox for each optional item
  2. Have the price of the corresponding item toggle between 0 and x (the item’s price) depending on the checkbox being selected or not
  3. Ideally update the total price with the sum of all the fields

The client would receive a PDF version of the file and be able to select the optional items he wants.

Is this possible? How can I create the code:

if(checkbox is
enabled){field=1234}else{field=0}

Please use more line breaks and punctuation in your question – at first I thought you were talking about an “optional item 2” and something “being selected or not 3”

Hi @mmalmeida,

Are you still looking for an Answer to this question?

Have you read all of the Online Help regarding Forms in LibreOffice?

I’m sorry that the help isn’t more extensive, but we’re mostly just volunteers here!

Best,

–Q