• Resolved oligenom

    (@oligenom)


    Dear developers,
    thank you for your great plugin!

    Is it possible to populate a form with values “stored” inside a button? For example i have a calculator for running pace and i want to include several buttons like “10k”, “Marathon”, “Half-Marathon” and so on, such that the user doesn’t have to write it themselves if they don’t want to.

    I already tried to include the Populate a Form by Default script in an onclick event, but it didn’t work.

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @oligenom

    I’ll try to describe the process with an example. But you should adjust it to your project.

    Assuming you have two fields in the form, fieldname1 and fieldname2 and want to fill them with values 123 and 456 by pressing a button.

    Insert a button field in the form and enter the following piece of code as its on-click event:

    
    getField('fieldname1', this.form).setVal(123);
    getField('fieldname2', this.form).setVal(345);
    

    Best regards.

    Thread Starter oligenom

    (@oligenom)

    Nice! This works like a charm ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Populate a form with click on a button’ is closed to new replies.