Scribus Forums

Scribus => Scripts and Plugins => Topic started by: Bleep on August 02, 2017, 12:30:46 AM

Title: Multiply a field value by a set value
Post by: Bleep on August 02, 2017, 12:30:46 AM
I'm hoping to create a PDF order form which automatically calculates a price if the user enters a quantity.

The quantity field is named q1 and the field for the calculated price is named p1.

I've tried adding a 'custom calculation script' to the p1 field. Unfortunately, I'm not very familiar with JavaScript, and I think I might be doing something completely wrong as the editor's 'OK' button is always greyed out. For instance, I tried this:

if (this.getField('q1').value) {
this.getField('t1').value = this.getField('q1').value * 7.5;
}


Any help would be much appreciated!