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

%>

Re: generating form on the fly by ll

ll
Mon May 05 16:36:27 CDT 2008

On May 5, 1:56 pm, ll <barn104_1...@yahoo.com> wrote:
> 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!