NYCPHP Meetup

NYPHP.org

[nycphp-talk] Need ideas on implementing this feature

(kris)janis p gale sharpwit at hotmail.com
Thu Sep 5 12:40:43 EDT 2002


for better debugging load the page up in netscape and then open the
javascript console by typing javascript: as the location...  gives far
better detail about syntax and specific problems with your js then
Inshmernet Exploiter ever will.

----- Original Message -----
From: Peter Simard <peter at panvox.net>
To: NYPHP Talk <talk at nyphp.org>
Sent: Thursday, September 05, 2002 11:22 AM
Subject: Re[2]: [nycphp-talk] Need ideas on implementing this feature


> Hello Tom,
>
> That's  the  route  I'm  working  throuhg  right  now,  however,  the
> Javascript  is  giving  me  headaches.   i  hate the way JS does error
> messages!
>
> Have  a  peek  at the function I'm writing to be called on each SELECT
> onChange:
>
> If you have any suggestions as to improvement please feel free
>
> Pete
> ***************
> function addToSelect(arr)
> {
>
>     var oOption;
>     var len = document.forms[1].elements[0].options.length;
>
>     for(var t = 0; t < len;  t++)
>     {
>         if(document.forms[1].elements[0].options[t].selected == true )
>         {
>             var text = document.forms[1].elements[0].options[t].value;
>             text = text.split(":");
>             alert(text[1]);
>             alert('Option index is: ' +
document.forms[1].elements[0].options[t].index );
>             alert('Option value is ' +
document.forms[1].elements[0].options[t].value);
>              for(var j = 0; j < arr.length; ++j)
>                 {
>                  if(text[1] == arr[j][0])
>                        {
>                           oOption = new Option(arr[i], arr[i]);
>                           file://alert(oOption);
>                           document.forms[1].elements[0].add(oOption);
>                           alert(oOption.text + ' is the text\
' +
oOption.value + ' is the value.');
>                       }
>                  }
>              }
>         }
>     }
>
>     Regards.
>
> --
>
>  Peter
> mailto:peter at panvox.net
>
> Mail management by:
> The Bat! 1.61
>
>
>
>
> --- Unsubscribe at http://nyphp.org/list ---
>
>
>



More information about the talk mailing list