Advertisement

08.18.2006 at 09:44AM PDT, ID: 21959501
[x]
Attachment Details

Calculation Function

Asked by ONYX in JavaScript

Tags: javascript, calculation, function

I'm trying to calculate some fields using an onchange event. If a field is blank, I want javascript to interpret it as a zero to use in a calculation, but I can't figure out what I'm doing wrong. Here is my function:

function calc(thevalue){
    if (thevalue = "" || isNull(thevalue)) {
    thevalue == 0
    alert(thevalue)
}

}

Thanks!Start Free Trial
[+][-]08.18.2006 at 09:47AM PDT, ID: 17343885

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2006 at 11:25AM PDT, ID: 17344521

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2006 at 01:42PM PDT, ID: 17345458

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.18.2006 at 07:03PM PDT, ID: 17346530

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.19.2006 at 09:07AM PDT, ID: 17348240

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: javascript, calculation, function
Sign Up Now!
Solution Provided By: MrHorizontal
Participating Experts: 3
Solution Grade: A
 
 
[+][-]08.24.2006 at 08:35AM PDT, ID: 17382511

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32