Solved

Java Script

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

733 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