Dynamic Form Generation Fails

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

    #1

    Dynamic Form Generation Fails

    I am using ASP to dynamically generate a series of forms. When the
    page is loaded, everything appears to be correct, except that the
    first form generated fails with a "FormName is Null or not an Object"
    error. Each subsuquent form created by the code after that works
    perfectly. Why is it that the first form, generated with exactly the
    same block of code, fails?

    Code Block: See ****** for form generation

    Function DisplayExisting ()
    if not (rsAssay.BOF) then
    rsAssay.MoveFir st
    strHTML = "</TR>"
    strHTML= strHTML + "<TR align='left' valign='middle' >"
    strHTML= strHTML + " <TD colspan='8' height='1'
    bgcolor='#99000 0'><IMG src='../../Images/spacer.gif'></TD>"
    strHTML= strHTML + "</TR>"
    strHTML= strHTML + "<TR valign='middle' align='left'>"
    strHTML= strHTML + " <TD height='30' align='center'
    class='columnte xt'>Current Values</TD>"
    'Build Row for Values
    Count = 1
    do while Not rsAssay.EOF
    if rsAssay.Fields. Item("replicate ").Value = Count then
    strHTML= strHTML + " <TD height='30' align='center'
    class='columnda ta'>" & rsAssay.Fields. Item("count").V alue & "</TD>"
    rsAssay.movenex t
    else
    strHTML= strHTML + " <TD height='30' align='center'
    class='columnda ta'>&nbsp;</TD>"
    end if
    Count = Count + 1
    Loop
    strHTML= strHTML + "</TR>"
    strHTML= strHTML + "<TR valign='middle' align='left'>"
    strHTML= strHTML + " <TD align='center'
    class='columnte xt'>Remove Replicate</TD>"

    *************** *****

    'Build Row for Deletion
    rsAssay.MoveFir st
    Count = 1
    do while Not rsAssay.EOF
    if rsAssay.Fields. Item("replicate ").Value = Count then
    strHTML= strHTML + " <FORM name='frmDel" & Count & "'
    action='birc_da ta_site_bioassa y_1.asp' method='Post'>"
    strHTML= strHTML + " <TD align='center' class='columnda ta'><A
    HREF=Javascript :window.documen t.frmDel" & Count & ".submit();><IM G
    src='../../Images/x.gif' border='0'></A>"
    strHTML= strHTML + " <INPUT name='lstAssay' type='hidden'
    value='" & request("lstAss ay") & "'>"
    strHTML= strHTML + " <INPUT name='intRep' type='hidden'
    value='" & Count & "'>"
    strHTML= strHTML + " </TD>"
    strHTML= strHTML + " </FORM>"
    rsAssay.movenex t
    else
    strHTML= strHTML + " <TD align='center'
    class='columnda ta'>&nbsp;</TD>"
    end if
    Count = Count + 1
    Loop
    strHTML= strHTML + "</TR>"
    strHTML= strHTML + "<TR align='left' valign='middle' >"
    strHTML= strHTML + " <TD colspan='8' height='1'
    bgcolor='#0000F F'><IMG src='../../Images/spacer.gif'></TD>"
    strHTML= strHTML + "</TR>"
    DisplayExisting = strHTML
    end if
    End Function
  • Lee

    #2
    Re: Dynamic Form Generation Fails

    Tim Pascoe said:[color=blue]
    >
    >I am using ASP to dynamically generate a series of forms.[/color]

    Your question doesn't seem to have anything to do with Javascript.

    Comment

    • tim pascoe

      #3
      Re: Dynamic Form Generation Fails

      Lee,

      Except that the code is using JAVASCRIPT to submit the generated forms.
      AND the error I am getting is a JAVASCRIPT error.

      Nice.

      Doesn't matter, I solved the problem without your volumes of help.

      Tim

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • kaeli

        #4
        Re: Dynamic Form Generation Fails

        In article <40211256$0$703 02$75868355@new s.frii.net>, tim.pascoe@cciw .ca
        enlightened us with...[color=blue]
        > Lee,
        >
        > Except that the code is using JAVASCRIPT to submit the generated forms.[/color]

        Not from what I could tell of that posted mess of VBScript, it isn't. I
        see a form with an action and a method.
        Not until I looked really closely inside a bunch of string statements
        did I see a link with the dreaded "javascript :" pseudo-protocol in it
        and realized that it was supposed to submit the form.
        You want people to help, post readable, testable code.
        [color=blue]
        > AND the error I am getting is a JAVASCRIPT error.
        >
        > Nice.
        >
        > Doesn't matter, I solved the problem without your volumes of help.
        >[/color]

        And the error was more than likely in the way the form was generated
        from the ASP code, since that was what you marked out as relevant. But
        we certainly can't tell from all the VBScript.
        You make the assumption that people here can even tell what that
        VBScript code does. Many do not. I have only a basic understanding of it
        myself.

        When you have a client-side javascript error, the error is on the
        client.
        Copy and paste the client code (view source), with no VBScript code, for
        people to look at.
        TESTABLE code, not stuff we need ASP to even comprehend.

        Getting your panties in a knot because someone saw reams of VBScript,
        not javascript, is rather silly.

        --
        --
        ~kaeli~
        Hey, if you got it flaunt it! If you don't stare at someone
        who does. Just don't lick the TV screen, it leaves streaks.



        Comment

        • Bas Cost Budde

          #5
          Re: Dynamic Form Generation Fails

          tim pascoe wrote:
          [color=blue]
          > Lee,
          >
          > Except that the code is using JAVASCRIPT to submit the generated forms.
          > AND the error I am getting is a JAVASCRIPT error.
          >
          > Nice.
          >
          > Doesn't matter, I solved the problem without your volumes of help.
          >
          > Tim[/color]

          You may be under stress but try to not let that influence your writing.

          --
          Bas Cost Budde


          Comment

          Working...