Dynamic Form Generation Fails

T

Tim Pascoe

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.MoveFirst
strHTML = "</TR>"
strHTML= strHTML + "<TR align='left' valign='middle'>"
strHTML= strHTML + " <TD colspan='8' height='1'
bgcolor='#990000'><IMG src='../../Images/spacer.gif'></TD>"
strHTML= strHTML + "</TR>"
strHTML= strHTML + "<TR valign='middle' align='left'>"
strHTML= strHTML + " <TD height='30' align='center'
class='columntext'>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='columndata'>" & rsAssay.Fields.Item("count").Value & "</TD>"
rsAssay.movenext
else
strHTML= strHTML + " <TD height='30' align='center'
class='columndata'>&nbsp;</TD>"
end if
Count = Count + 1
Loop
strHTML= strHTML + "</TR>"
strHTML= strHTML + "<TR valign='middle' align='left'>"
strHTML= strHTML + " <TD align='center'
class='columntext'>Remove Replicate</TD>"

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

'Build Row for Deletion
rsAssay.MoveFirst
Count = 1
do while Not rsAssay.EOF
if rsAssay.Fields.Item("replicate").Value = Count then
strHTML= strHTML + " <FORM name='frmDel" & Count & "'
action='birc_data_site_bioassay_1.asp' method='Post'>"
strHTML= strHTML + " <TD align='center' class='columndata'><A
HREF=Javascript:window.document.frmDel" & Count & ".submit();><IMG
src='../../Images/x.gif' border='0'></A>"
strHTML= strHTML + " <INPUT name='lstAssay' type='hidden'
value='" & request("lstAssay") & "'>"
strHTML= strHTML + " <INPUT name='intRep' type='hidden'
value='" & Count & "'>"
strHTML= strHTML + " </TD>"
strHTML= strHTML + " </FORM>"
rsAssay.movenext
else
strHTML= strHTML + " <TD align='center'
class='columndata'>&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='#0000FF'><IMG src='../../Images/spacer.gif'></TD>"
strHTML= strHTML + "</TR>"
DisplayExisting = strHTML
end if
End Function
 
T

tim pascoe

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
 
K

kaeli

Lee,

Except that the code is using JAVASCRIPT to submit the generated forms.

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.
AND the error I am getting is a JAVASCRIPT error.

Nice.

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

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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 
B

Bas Cost Budde

tim said:
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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top