473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

generating form on the fly

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

%>
Jun 27 '08 #1
1 1493
ll
On May 5, 1:56 pm, ll <barn104_1...@yahoo.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=""#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!
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # David Eppstein of the Geometry Junkyard fame gave this elegant # version for returing all possible pairs from a range of n numbers. def combo2(n): return...
17
by: flupke | last post by:
Hi, i create my GUIs mainly via wxGlade. However when you start of to program and want to do some rearranging to the gui, wxglade overwrites your file and you've got to put your own code back...
4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
3
by: Le, Thanh-Nhan | last post by:
Hi, I am a beginer in .NET. Is there an assistant or a free tool as in VB6 for generating a complete project frame in VS .NET. Thanks Nhan
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
4
by: Bill J | last post by:
Hi Everyone, Is there a way of generating a keyboard character event and sending it to a control on a form? For example, if I have a menu item called "Delete", I would like to send a DEL...
0
SammyB
by: SammyB | last post by:
These are some "random" thoughts about generating random numbers in Visual Basic. Wikipedia will give a better introduction than I, see http://en.wikipedia.org/wiki/Random_number_generator. ...
3
by: deciacco | last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview control to redraw the preview I get the...
1
by: Krimp | last post by:
I pulled this code from Vbasic.net or generating random passwords. I want to know how I can set up so that each time the page is refreshed a new password is generated without having to fill in the...
1
by: Lelu | last post by:
Hi, My HTML form is generating some blank email responses; does anyone see anything wrong with the scripts?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.