Solved

Java Script

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
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 …
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 …

696 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