Solved

Java Script

Posted on 2004-09-16
3
265 Views
Last Modified: 2010-04-17
Hi

Any body correct this script. So that I want to display nothing when there is value is 0.

var a=this.getField("Don_Amt");
event.value=a.value*1.12
if ((event.value) <0){
event.value=" "
}

Nava
0
Comment
Question by:navaraj111
  • 3
3 Comments
 
LVL 32

Expert Comment

by:ldbkutty
ID: 12077882
var a=this.getField("Don_Amt");
event.value=((a.value*1.12) == 0) ? "":a.value*1.12;

OR:

var a=this.getField("Don_Amt");
event.value=a.value*1.12;
if ((event.value) ==0){
    event.value="";
}

Is this what you want?
0
 
LVL 32

Accepted Solution

by:
ldbkutty earned 100 total points
ID: 12077912
if you want to have empty value for event.value when the value is less than or equal to 0,

var a=this.getField("Don_Amt");
event.value=a.value*1.12;
if ((event.value) <=0){
    event.value="";
}

if it is not what you want, please tell me.
0
 
LVL 32

Expert Comment

by:ldbkutty
ID: 12078038
why B grade ? :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installed softare without GUID 6 65
listing all functions in JavaScript 19 173
index Out OF Range Exception error 4 53
C# application error "Parameter Is Not Valid". 3 75
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now