generating form on the fly

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

    generating form on the fly

    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=""#FFFF CC""
    align=""center" "><input name=""textfiel d"" 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("f rmCopyContent") = "Copy" Then
    strCopyCourseID = Request.Form("s trCopyCourseID" )

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

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

    <%num=1

    Do While Not objComm.EOF
    strCourseID = objComm("Course ID")
    strObjective1 = objComm("Object ive")

    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.queryst ring("CourseID" )
    strObjective = strObjective & "<tr height=""50"">< form><td
    align=""left""" & strObjective1 & "</td>" & _


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

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

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

    %>
  • ll

    #2
    Re: generating form on the fly

    On May 5, 1:56 pm, ll <barn104_1...@y ahoo.comwrote:
    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=""#FFFF CC""
    align=""center" "><input name=""textfiel d"" 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("f rmCopyContent") = "Copy" Then
    strCopyCourseID = Request.Form("s trCopyCourseID" )
    >
    strSQL = "SELECT ID, CourseID, Objective, Out1, OutP1 " & _
    "FROM AMS_ContentOver viewObjectiveOu tcome " & _
    "WHERE " & _
    "CourseID = '" & strCopyCourseID & "' ;"%>
    >
    <!--- assign table data to variable strings --->
    <!--#include virtual="/common/db/QryDbCommand.as p"-->
    >
    <%num=1
    >
    Do While Not objComm.EOF
    strCourseID = objComm("Course ID")
    strObjective1 = objComm("Object ive")
    >
    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.queryst ring("CourseID" )
    strObjective = strObjective & "<tr height=""50"">< form><td
    align=""left""" & strObjective1 & "</td>" & _
    >
    "<td bgcolor=""#FFFF CC"" align=""center" "><input name=""textfiel d""
    type=""text"" id=""textfield" " value="" & strOut1 & strOutP1 & ""
    size=""1"" />" & "</td>" & _
    >
    "<td bgcolor=""#FFFF CC"" align=""center" "" & strOut1 & strOutP1 & "</
    td>" & _
    >
    "</form></tr>"
    objComm.MoveNex t
    num=num+1
    loop
    >
    %>


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

    Comment

    Working...