vs2k5 equiv.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rodchar

    vs2k5 equiv.

    hey all,
    in vs2k3 i could loop thru all the elements in the document like the
    following:
    function getscrollvalue( ){
    elm=document.Fo rm1.elements;
    for(i=0;i<elm.l ength;i++)
    if(elm[i].type=="text" && elm[i].name.match("sc rollvalue")!=nu ll){
    a=elm[i];
    a.value=(a.valu e=="")?0:a.valu e
    }
    }

    is it different in vs2k5? because i'm getting "form1 is null or not an object"


    thanks,
    rodchar
  • Tarren

    #2
    Re: vs2k5 equiv.

    form1 is referring the id of the from on the actual aspx page (HTML)

    Look on the page and see what the id is for the default form and adjust your
    code accordingly


    "rodchar" <rodchar@discus sions.microsoft .comwrote in message
    news:8C9643FC-6F64-468C-9045-4EE9CED21538@mi crosoft.com...
    hey all,
    in vs2k3 i could loop thru all the elements in the document like the
    following:
    function getscrollvalue( ){
    elm=document.Fo rm1.elements;
    for(i=0;i<elm.l ength;i++)
    if(elm[i].type=="text" && elm[i].name.match("sc rollvalue")!=nu ll){
    a=elm[i];
    a.value=(a.valu e=="")?0:a.valu e
    }
    }
    >
    is it different in vs2k5? because i'm getting "form1 is null or not an
    object"
    >
    >
    thanks,
    rodchar

    Comment

    • Marina Levit [MVP]

      #3
      Re: vs2k5 equiv.

      This has nothing to do with Visual Studio. This looks like client side
      javascript? In which case, you don't have a form called Form1 on your page.

      "rodchar" <rodchar@discus sions.microsoft .comwrote in message
      news:8C9643FC-6F64-468C-9045-4EE9CED21538@mi crosoft.com...
      hey all,
      in vs2k3 i could loop thru all the elements in the document like the
      following:
      function getscrollvalue( ){
      elm=document.Fo rm1.elements;
      for(i=0;i<elm.l ength;i++)
      if(elm[i].type=="text" && elm[i].name.match("sc rollvalue")!=nu ll){
      a=elm[i];
      a.value=(a.valu e=="")?0:a.valu e
      }
      }
      >
      is it different in vs2k5? because i'm getting "form1 is null or not an
      object"
      >
      >
      thanks,
      rodchar

      Comment

      • rodchar

        #4
        RE: vs2k5 equiv.

        doh! thanks for the help.

        "rodchar" wrote:
        hey all,
        in vs2k3 i could loop thru all the elements in the document like the
        following:
        function getscrollvalue( ){
        elm=document.Fo rm1.elements;
        for(i=0;i<elm.l ength;i++)
        if(elm[i].type=="text" && elm[i].name.match("sc rollvalue")!=nu ll){
        a=elm[i];
        a.value=(a.valu e=="")?0:a.valu e
        }
        }
        >
        is it different in vs2k5? because i'm getting "form1 is null or not an object"
        >
        >
        thanks,
        rodchar

        Comment

        Working...