generating form on the fly

L

ll

Hi,
I''ve inherited a website and am working on a page to generate an html
form on the fly. I'm trying to add a form to the existing code which
generates an html table on the fly. The problem I'm experiencing is
how to get the value from the variables into the form's input boxes.

The code I've added is towards the bottom at: "<td bgcolor=""#FFFFCC""
align=""center""><input name=""textfield"" type=""text""
id=""textfield"" value="" & strOut1 & strOutP1 & "" size=""1"" />" &
"</td>" & _
I'm not sure if it's a problem with escaping the quotes, etc.
Thanks for any help!

===============
Here's the code:

<%If Request.Form("frmCopyContent") = "Copy" Then
strCopyCourseID = Request.Form("strCopyCourseID")

strSQL = "SELECT ID, CourseID, Objective, Out1, OutP1 " & _
"FROM AMS_ContentOverviewObjectiveOutcome " & _
"WHERE " & _
"CourseID = '" & strCopyCourseID & "' ;"%>

<!--- assign table data to variable strings --->
<!--#include virtual="/common/db/QryDbCommand.asp"-->

<%num=1

Do While Not objComm.EOF
strCourseID = objComm("CourseID")
strObjective1 = objComm("Objective")

strOut1 = objComm("Out1")
strOutP1 = objComm("OutP1")

remainder = num mod 2

if strOut1 = "N/A" then
strOut1 = "&nbsp; "
else
strOut1 = strOut1 & "<br>"
end if

if strOutP1 then
strOutP1 = "<b>PR</b>"
else
strOutP1 = "&nbsp;"
end if


strCourseID2= Request.querystring("CourseID")
strObjective = strObjective & "<tr height=""50""><form><td
align=""left""> " & strObjective1 & "</td>" & _


"<td bgcolor=""#FFFFCC"" align=""center""><input name=""textfield""
type=""text"" id=""textfield"" value="" & strOut1 & strOutP1 & ""
size=""1"" />" & "</td>" & _

"<td bgcolor=""#FFFFCC"" align=""center""> " & strOut1 & strOutP1 & "</
td>" & _

"</form></tr>"
objComm.MoveNext
num=num+1
loop

%>
 
L

ll

Hi,
I''ve inherited a website and am working on a page to generate an html
form on the fly. I'm trying to add a form to the existing code which
generates an html table on the fly. The problem I'm experiencing is
how to get the value from the variables into the form's input boxes.

The code I've added is towards the bottom at: "<td bgcolor=""#FFFFCC""
align=""center""><input name=""textfield"" type=""text""
id=""textfield"" value="" & strOut1 & strOutP1 & "" size=""1"" />" &
"</td>" & _
I'm not sure if it's a problem with escaping the quotes, etc.
Thanks for any help!

===============
Here's the code:

<%If Request.Form("frmCopyContent") = "Copy" Then
strCopyCourseID = Request.Form("strCopyCourseID")

strSQL = "SELECT ID, CourseID, Objective, Out1, OutP1 " & _
"FROM AMS_ContentOverviewObjectiveOutcome " & _
"WHERE " & _
"CourseID = '" & strCopyCourseID & "' ;"%>

<!--- assign table data to variable strings --->
<!--#include virtual="/common/db/QryDbCommand.asp"-->

<%num=1

Do While Not objComm.EOF
strCourseID = objComm("CourseID")
strObjective1 = objComm("Objective")

strOut1 = objComm("Out1")
strOutP1 = objComm("OutP1")

remainder = num mod 2

if strOut1 = "N/A" then
strOut1 = " "
else
strOut1 = strOut1 & "<br>"
end if

if strOutP1 then
strOutP1 = "<b>PR</b>"
else
strOutP1 = " "
end if

strCourseID2= Request.querystring("CourseID")
strObjective = strObjective & "<tr height=""50""><form><td
align=""left""> " & strObjective1 & "</td>" & _

"<td bgcolor=""#FFFFCC"" align=""center""><input name=""textfield""
type=""text"" id=""textfield"" value="" & strOut1 & strOutP1 & ""
size=""1"" />" & "</td>" & _

"<td bgcolor=""#FFFFCC"" align=""center""> " & strOut1 & strOutP1 & "</
td>" & _

"</form></tr>"
objComm.MoveNext
num=num+1
loop

%>



I think I've found the solution to this - quite obvious, but thanks
anyway!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top