0

I've got a problem with my form (an invoice, you can see pdf file at http://www.fornoantico.it/fatture/fattura-definitiva-togli-zeri.pdf), in particular on a calculated field... I want to hide it if value = 0, but it doesn't disappear

I've tried to use Action Builder, but "ok" button is disabled, and shows this alert "actions may not work with forms targeting html or guide"

I've tried to use some formulas like

if (IMPORTO[0] == 0) then

IMPORTO_SCONTATO[0].presence="invisible"

else

IMPORTO_SCONTATO[0].presence="visible"

endif

(I've got a IMPORTO field that contains Quantity * Price, then a SCONTO flied that contains only the discount value calculated as IMPORTO * SCONTO / 100, and an IMPORTO_SCONTATO field that contains that contains the price inclouding discount, calculated as IMPORTO - SCONTO)

But it doesn't work, this IMPORTO_SCONTATO field is always present showing 0 value, and this is a problem because in this invoice if we have a few rows then we have zeros in other ones (see image)

Can you please help me solving this issue? I'm going nuts, I'm working on it since last week.

Thanks a lot

enter image description here

satboy78
  • 217
  • 1
  • 5
  • 14
  • I wanted to take a look at you formulas but the link to the form is broken. If you didn't solve the problem by now, let me have a look. – bassim Oct 16 '12 at 10:41
  • I've created another form, where I can add and deete table rows. Thanks a lot – satboy78 Oct 26 '12 at 19:38

2 Answers2

1

I think you missed the .rawValue.

if (IMPORTO[0].rawValue == 0)
{
    IMPORTO_SCONTATO[0].presence="visible";
}
else
{
    IMPORTO_SCONTATO[0].presence="hidden";
}
Augier
  • 311
  • 2
  • 13
-1

Try this, I also had the same problem for a bill:

var v = event.value;
if (v == 0)
{
    event.target.display = display.hidden;
}
else
{
    event.target.display = display.visible;
}
Corey Adler
  • 15,897
  • 18
  • 66
  • 80
Matteo
  • 1
  • Please use only English language on StackOverflow – xav May 30 '14 at 20:22
  • @xav, [its easy enough to translate](https://translate.google.com/#auto/en/prova%20con%20questo%2C%20anche%20io%20avevo%20lo%20stesso%20problema%20per%20una%20fattura), but I do tend to agree – wnnmaw May 30 '14 at 20:26
  • @wnnmaw So if it's easy to translate, each one should take the time/effort to translate in English before posting :) Image if every body write there using his/her mother tongue... – xav May 30 '14 at 20:29