Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    listbox filling failure

    Hi,

    Can somebody help me about following script.
    (JS error: 'undefined' is null or not an object)
    PHP Code:
    <html>

    <
    head>

    <
    meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <
    meta name="ProgId" content="FrontPage.Editor.Document">
    <
    meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <
    title>New Page 1</title>
    <
    script language="JavaScript1.1">
    <!--
    expDate= new Date();
    expDate.setDate(expDate.getDate() + 1);
    // Public domain cookie code written by:
       // Bill Dortch, hIdaho Design (bdortch@netw.com)
    function SetCookie(name,value,xDate) {
         var 
    argv SetCookie.arguments;
         var 
    argc SetCookie.arguments.length;
         var 
    expires = (argc 2) ? argv[2] : null;
         var 
    path = (argc 3) ? argv[3] : null;
         var 
    domain = (argc 4) ? argv[4] : null;
         var 
    secure = (argc 5) ? argv[5] : false;
         
    document.cookie name "=" escape(value) +
                      ((
    expires == null) ? "" : ("; expires=" +                     expires.toGMTString())) +
                      ((
    path == null) ? "" : ("; path=" path)) +
                      ((
    domain == null) ? "" : ("; domain=" domain)) +
                      ((
    secure == true) ? "; secure" "");
     }
     
     function 
    GetCookie(name) {
         var 
    arg name "=";
         var 
    alen arg.length;
         var 
    clen document.cookie.length;
         var 
    0;
         while (
    clen) {
             var 
    alen;
             if (
    document.cookie.substring(i,j) == arg)    {
                 return 
    getCookieVal(j);
             }
             
    document.cookie.indexOf(" "i) + 1;
             if (
    == 0) break;
         }
         return 
    null;
     }
     
     function 
    getCookieVal(offset) {
         var 
    endstr document.cookie.indexOf(";"offset);
         if (
    endstr == -1)    {
             
    endstr document.cookie.length;
         }
         return 
    unescape(document.cookie.substring(offsetendstr));
     }
    // End of Bill Dortch's Public Domain Cookie Code


        
    function fillList() { 
                
    x=GetCookie("cookie_1");
                if(
    x!=null) {
                    var 
    arrPrevOrdx.split("*");
                                                        
                    
    j=arrPrevOrd.length;            
                    for(
    i=0i<ji++) {
                    
    document.form1.select1.options[i].text=arrPrevOrd[i];
                    }               
                 }
         }


        function 
    readList(selectX) {
                
    str="";
                
    elemNmselectX.options.length;
                for(
    i=0i<elemNmi++) {
                    if(
    selectX.options[i].text != "&")           //drop empty(&) row
                    
    str+= "*"+selectX.options[i].text;
                }
                return 
    str;
            }


        function 
    deleteRow() {
                
    seldocument.form1.select1.selectedIndex;
                
    document.form1.select1.options[sel].text="&";      //empty mark       
                      
                
    SetCookie("cookie_1"readList(document.form1.select1), expDate);
                
                }                    
          

        function 
    inputF() {
            var 
    inputValdocument.form1.text1.text;
            var 
    newArrinputVal.split("*");

            for(
    i=0i<newArr.lengthi++) {
                 
    document.form1.select1.options[i].text=newArr[i];
                 }
            
    SetCookie("cookie_1"inputValexpDate);     
        }    
    -->
    </script>
    </head>

    <body onLoad="fillList()">

    <form name="form1" method="POST" action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
      <!--webbot bot="SaveResults" u-file="_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" --><p>
          <input name="text1" type="text" size="59" value="1111">&nbsp;&nbsp;
          <input onClick="inputF()" type="button" value="Input" name="B3">&nbsp;&nbsp; 
          '*' as delimiter</p>
      <p>
          &nbsp;</p>
      <p>
          <select name="select1" size="5" style="width: 300; font-family:Times New Roman; font-size:10pt">
          <option selected>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          <option>&</option>
          </select></p>
      <p><input onClick="deleteRow()" type="button" value="Delete" name="B2">&nbsp; highlited row</p>
    </form>

    </body>

    </html> 
    Thanks
    Last edited by registered_memb; 05-23-2005 at 10:30 PM.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Quote Originally Posted by registered_memb
    Code:
    	function inputF() {
    		var inputVal= document.form1.text1.text;
    Change .text to .value


  •  

    Posting Permissions

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