Solved

Java Script

Posted on 2004-09-16
3
250 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

747 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

10 Experts available now in Live!

Get 1:1 Help Now