?
Solved

Java Script

Posted on 2004-09-16
3
Medium Priority
?
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Starting up a Project
Suggested Courses

752 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