|
From: ll on 5 May 2008 14:56 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 %>
From: ll on 5 May 2008 17:36 On May 5, 1:56 pm, ll <barn104_1...(a)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!
|
Pages: 1 Prev: Disable the PrintScreen Button from web application Next: persist session info |