English 中文(简体)
2. 在一个有javascript的领域中获得贴现和显示
原标题:Get the discount and show in a field with javascript

我有5个领域。 Qty, 零售、贴现、总贴现和总额。 我想在一栏中显示总贴现,然后在总栏中显示总贴现。 这是在人民抵抗力量文件范围内执行的 j。

Qty Retail (RetailPrice) Discount %(DiscRow1) T Discount (DiscountRow1) Total
1 100 .10 $10 $90
function calculateDiscount() {
    var qty = this.getField("Qty").value;
    var retailPrice = this.getField("RetailPrice").value;
    var discountPerc= this.getField("DiscRow1").value;

    retailPrice = parseFloat(retailPrice);

    var totalPrice = qty * retailPrice;

    var discountPercentage = discountPerc;

    var discountAmount = totalPrice * discountPercentage;

    this.getField("DiscountRow1").value = discountAmount.toFixed(2); // Fixed to 2 decimal places
}

this.getField("Qty").setAction("Calculate", calculateDiscount);
this.getField("RetailPrice").setAction("Calculate", calculateDiscount);

https://i.sstatic.net/md9GXIJD.png”rel=“nofollow noreferer”> 我的PDF形象

问题回答

动态的PDF问题之一是,它需要在所有读者中工作而不出现问题,而联合材料并不是一个好的想法,因为它在客户编辑中触发重建(国际投资论坛的安全使国防军的文字得以操作)。 在这里,我们把警示放在表上左角的顶端。

“entergraph

Similar here in an Edit/Reader it warns they are interactive. enter image description here

Answer

you need this object as the last field.

4 0 obj
<</AA<</C<</JS(var get1 = this.getField("Qty").valueAsString;
var get2 = this.getField("Retail").valueAsString;
var get3 = this.getField("TDiscount").valueAsString;
var total = (get1*get2)-(get3);
event.value =  total;)/S/JavaScript>>/F<</JS(AFNumber_Format(2, 0, 0, 0, "\u0024 ", true))/S/JavaScript>>/K<</JS(AFNumber_Keystroke(2, 0, 0, 0, "\u0024 ", true))/S/JavaScript>>>>/AP<</N 11 0 R>>/DA(0 g /Helv 0 Tf)/F 4/Ff 1/FT/Tx/M(D:20240513200224+01 00 )/MK<</BC[0 0 0]>>/P 11 0 R/Q 2/Rect[296.8653 503 356.8653 525]/Subtype/Widget/T(Total)/Type/Annot/V(90)>>
endobj

What that needs is an input something like,

var get1 = this.getField("Qty").valueAsString;
var get2 = this.getField("Retail").valueAsString;
var get3 = this.getField("TDiscount").valueAsString;
var total = (get1*get2)-(get3);
event.value =  total;

www.un.org/spanish/ecosoc 您能否看到产出中的无意错误? 计算是错误的时机!

就大宗填充而言,比较安全(假设你的数学是正确的),更简单地使用静态未加规范的田地,简单地将案文作为简单案文加以双倍点或自动点击。

%FDF-1.4
%âãÏÓ
1 0 obj<</FDF <</F (Sample2.pdf)/Fields
[  <</T (Company)
>> <</T (Phone)/V(+4412345678)
>> <</T (Contact)/V (Diamond Geezer)
>> <</T (ItemRow1)/V(My 1st is in Field)
>> <</T (StyleRow1)
>> <</T (ColourRow1)
>> <</T (SizeRow1)
>> <</T (QtyRow1)/V(2)
>> <</T (RetailPriceRow1)/V(£100)
>> <</T (DiscRow1)/V(10%)
>> <</T (DiscountRow1)/V(£20)
>> <</T (TotalRow1)/V(£180)
>> ]/ID [<2DCC0FC03800B0120B0F0A87E4FD3B3B><507E3BFFD93F56F60569739DF98E1562>]
/UF (Sample2.pdf)>>/Type /Catalog>>
endobj
trailer
<</Root 1 0 R>>
%%EOF

以上是国防军正确的档案名称,两度点击。 然后,缩略语或读者将要求模板。 与客户一样,需要与个人发票相提并论。 因此,数学不属于PDF和E&OE更有可能从非行或申请/pdf得到纠正。

“entergraph





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签