[Javascript] Re: Javascript Digest, Vol 7, Issue 13

David Lovering dlovering at gazos.com
Fri Sep 19 17:42:06 CDT 2003


Dear Andy:

Well at least part of that I can help you with --

if (!object) {
  // do something if object doesn't exist at all
}

if (object == "") {
  // do something else if object exists, but is null
}

The first one should cover the case where object is undefined.

-- Dave Lovering

I think I understand now what you say you are doing, but I'm still not a
100% on what you WANT the code to do.  Let's see if I've got it straight:

  (1)    There's a button (presumably only one on the form), which when
pressed jumps to a routine.  This routine accepts as input an integer.  If
the object "chk_##" exists, where ## corresponds to the numerical value of
the passed integer, then nothing much happens.  If, on the other hand, the
object "chk_##" DOESN'T exist, then the routine will create a check box of
name 'chk_##" (or whatever).

  (2)    Where does the passing integer come from?

  (3)    What are you using to define the parent for the newly created
check-box?  Remember, any created object must be spawned as a child of an
already existing object, unless you plan to only run this routine one-time
at first load.  If so, there's no point in having a button to create new
chk-boxes.


----- Original Message ----- 
From: "andy susanto" <andy78 at centrin.net.id>
To: <javascript at LaTech.edu>
Sent: Friday, September 19, 2003 1:31 PM
Subject: [Javascript] Re: Javascript Digest, Vol 7, Issue 13


> David Lovering,
>
> Thanks for your replay, i am try to enlightenment my code.
>
> my goal is i am trying to check if  "jml object" has a value or not.
>
> if  "jml object" has a value i must create Input Tag again after user
click
> the button, just like that.
>
> the problem is when i try to check that value for "jml object" with
> "function alertvalue(obj,idx)" i expecting value of idx is an object so i
am
> use "eval function" and the word "undefined" is a mistake(because i do not
> know how to check a null value on javascript).
>
> i hope my this mail can be enlightenment
>
> TIA,
>
> andy
>
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>





More information about the Javascript mailing list