LibreOffice Writer: Using Text Box to Auto Populate Other Text Boxes

I’m creating a fillable PDF form in Writer to save the user time, I need the text they input into a text box to auto populate into another text box somewhere else in the same form. How do I achieve this? Is a text box the best way to achieve this? If so, how? If not, what is the best way?

A form’s text box is intended to write some text into a database record. A text box has a fixed length, so a short name leaves a gap in your text whereas a long text may not be shown in full length.
Text fields with variable length are embedded in the text flow.
Hit Ctrl+F2, tab “Variables” and set up a variable name and value.
Now you can insert and copy the field with that value anywhere in your document.

So when I have the text box selected, Ctrl+F2 does not work. If I select the text box and try to navigate to Insert>Field, all options are greyed out, including More Fields.

A form does not necessarily have to generate database entries. A form, e.g. with a text field, is usually also used for manual entries on the screen. See:

Create a fillable form in Writer


If you now have a field on page 1 and enter a text there, but at the same time you want the same text to appear in a text field on page 2, for example, you must give both text fields the same name in the field properties, e.g. “Textfield1”.


Please note that as of version 7.5 there are new content controls that should provide better compatibility with MS-Word:
Content Controls in Writer

1 Like

Where can I find the field properties for a text box? If you’re talking about right clicking the text box and choosing content control, I see a field for a name and label field. I would think the Label Field is the one I need to give the name to but it will not let me type anything in that field. If I click the 3 dots beside the field I get Label Field Selection but even if I choose the Forms option in the menu and click okay, I still cant add anything if the Label Field.

I apologize if I’m not understanding correctly.

No cross references without database. Once the form control value is stored in a db, you can insert the same form control with the same value in many places. And you can insert mail merge fields based on stored database values.
Writer’s text fields are not properly documented. I only get variable fields working. The text field dialog offers cross references and input fields with references on the “Functions” tab, but I never saw any working example.

1 Like

Maybe it’s because I didn’t go to sleep until 4:30am working on this form but can you provide specific instructions on how to achieve what I’m asking? I appreciate everyone’s help.

@Krhamm ,

See above the link.

Have a look at the attachment in Apache OpenOffice Community Forum - Using text boxes and bookmarks to automatically copy text - (View topic)

Text fields vs. form controls.
Database_form_controls.odt (49.6 KB)

Thanks for the help, I was able to give a text box a Data Field such as 'Identifier" and any other text box I gave the Data Field as ‘Identifier’ would populate with the same text, which is what I wanted to do. I also made the subsequent text boxes readable only which is ideal.
|
There’s a couple of issues I need to resolve though.
|
I would like to name my own Data Field so it matches the type of data going into the text box. In my situation I am inputting Model Numbers of devices. So I’d like to name the Data Field Model 1, Model 2, and so on. It looks like I can type anything into the Data Field but unless I select one of the pre-made options, the other boxes won’t auto-populate. Is there anyway to fix this or do I just have to stick to the pre-made options?
|
Second issue, when I am out of design mode, the boxes auto-populate and are readable-only just like I want. However, when I export this form into PDF, which is ultimately what I want the user to fill out, neither auto-population nor readable-only works as intended. How do I fix this so this happens in the PDF form as well?