Array Problem

Results 1 to 2 of 2

Thread: Array Problem

  1. #1
    Join Date
    Dec 1969

    Default Array Problem

    I have 1 set of controls displayed when a page loads, then I have a button that dynamically creates an array, placing the first set of controls that was already there into the array. I have a place where a date can be entered. If there is only 1 set of controls, I want it to not be in the array like below:<BR><BR>&#060;td valign=top width=5%&#062;<BR>&#060;a href=javascript:show_calendar(&#039;AddTime.weeken d&#039;);&#062;<BR>&#060;img src=&#039;../images/calendar.gif&#039; width=24 height=22 border=0&#062;&#060;/a&#062;&#060;/td&#062;<BR><BR>but when there is more than 1 set of controls, I want it to be something like &#039;AddTime.weekend[0]&#039; to be the first element of the array. I can&#039;t figure out how to do this. If I hard code the [0] in, it will tell me that AddTime.weekend.0 is null or not an object. Any suggestions??

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default use typeof

    fine out it it exits or not and then add your code<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts