Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another request from good people like you!

Status
Not open for further replies.

janise

Technical User
May 25, 2003
161
US
What I would like to accomplish with the code above is to do three things.
One is to list all the courses that are available to employees based on their positions.
Eg, a supervisor might have 15 courses available to him/her.
Of these 15 courses, some will be required of him/her to take and some will be optional.
I need one checkbox that when checked, means that the course is required. If the course is not required, this checkbox will be left blank.
On the same issue, if this course is required, is it taken by the employee concerned, if yes, again, there will be a checkbox checked. If not checked, the checkbox will be left blank.
Then there will be a textarea that says if this required class is not taken, write an explanation in the text area.
So we have a field called courseDesc, a name for the course, courseType, this indicates whether the course is required or not, then a courseStatus that indicates whether not or not the course is taken.
Individual, I have a code that handles all of these.
My problem is to line them up in that they will look like this:
coursetype(Required or not) CourseStatus(Taken or not)
Course1 checkbox for required checkbox for taken
course2 same here same here
. same here same here
. same here same here
. same here same here
courseN same here same here

Your help is greatly appreciated
What I need to do is to list all the courses and then
 
I don't get it.

It seems to me you need a crash course in RDMS.
 
To line them up nicely just put the checkboxes etc into a table. <p><b><font face=&quot;Arial&quot; size=&quot;2&quot;>
<span style=&quot;FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial&quot;>
Saturday...... &nbsp; 12:00hrs.....</span></font></b><img src=&quot; height=&quot;50&quot; src=&quot; wi
 
No CDN, I am not asking anyone to design an RDBMS for me.
I am just asking for help in lining up the fields and checkboxes.
This is what I have so far.

<% @language=&quot;vbscript&quot; %>

<%

'Forces you to explicitly declare all local variables.
This is a good way to code

option explicit
dim rs
dim conn
dim strconn
dim strsql

strconn = &quot;dsn=stract;uid=sokeh;pwd=sonn1e&quot;

set conn = server.createobject(&quot;adodb.connection&quot;)

conn.open strconn
strsql = &quot;select * from courses&quot;
set rs = conn.execute(strsql)

%>

<html>
<head>

<title>Writing out text Areas</title>

</head><body bgcolor=&quot;steelBLUE&quot;>

<table bgcolor=&quot;khaki&quot;><tr><td>

<form method=&quot;POST&quot; action=&quot;textboxes.asp&quot;>

<p>Coures Required?: <input type=&quot;checkbox&quot;
name=&quot;txtRequired&quot; <%if rs(&quot;CourseType&quot;) = &quot;Req&quot; then Response.Write(&quot;checked&quot;)%>value=&quot;ON&quot; value=&quot;ON&quot;></p>

<p>Course Taken?:<input type=&quot;checkbox&quot;
name=&quot;txtTaken&quot; <%if rs(&quot;CourseStatus&quot;) = &quot;YES&quot; then Response.Write(&quot;checked&quot;)%>value=&quot;ON&quot; value=&quot;ON&quot;></p>


<p>Reason For Not Taken</p>

<p><textarea rows=&quot;5&quot; name=&quot;S1&quot; cols=&quot;24&quot;><% =
rs(&quot;Comments&quot;) %></textarea></p>

</form>
</td</tr></table>
</body>
<%
conn.close
set conn = nothing

%>
</html>
 
<table bgcolor=&quot;khaki&quot;><tr>
<td valign=&quot;top&quot;>Course Required?</TD>
<TD valign=&quot;top&quot;>
<input type=&quot;checkbox&quot; name=&quot;txtRequired&quot; <%if rs(&quot;CourseType&quot;) = &quot;Req&quot; then Response.Write(&quot;checked&quot;)%>value=&quot;ON&quot; value=&quot;ON&quot;></TR><TR>
<TD valign=&quot;top&quot;>Course Taken?</TD>
<TD valign=&quot;top&quot;>
<input type=&quot;checkbox&quot; name=&quot;txtTaken&quot; <%if rs(&quot;CourseStatus&quot;) = &quot;YES&quot; then Response.Write(&quot;checked&quot;)%>value=&quot;ON&quot; value=&quot;ON&quot;></TR><TR>
<TD valign=&quot;top&quot;>Reason For Not Taken</TD>
<TD valign=&quot;top&quot;><textarea rows=&quot;5&quot; name=&quot;S1&quot; cols=&quot;24&quot;><%=rs(&quot;Comments&quot;) %></textarea></TD>
</tr></table>
 
Seems to me we need a check box to mark a response as 'unhelpfull'. Maybe put a zx81 logo instead of a star?
 
GaryC, thank you!
SimonDavis, I am lost. What do you mean?
Thanks everyone for the help!!!
 
I think I'm stepping over a tek-tips line here, but I thought CDN could have been a little more polite.

 
I have been in database (oracle, sql server, db2) for most of my career.
Due to soft economy, employers now expect you to know &quot;everything&quot;.
Being unemployed for 13 months, I can't afford asp/htm books right now. So I have to rely on good people like you.
As a result, I have become a &quot;web developer&quot;.
I am truly grateful to people like GaryC123, onpnt, tarwn and a host of others who go out of their way to help others.
6 months from now, I will be able to offer to others the same help that have been offered to me; same help I have offered in the database spaces.
 
Sorry to bother you folks again on this.
If I am coding this using sql, I will code it like:
select courseType as &quot;Required&quot;, CourseStatus as &quot;Taken&quot;
from table.
This will return: Required Taken
Yes Yes
Yes No
No No etc.
Then I will use crosstab to add course Description.
So that My result will look like:

This will return: Required Taken
Into To DBO Yes Yes
SafetY Measures Yes No
SharePoint Admin No No etc.

And then I will select another field called reasons as comments on the right side of the &quot;Taken&quot;.
Then I will say something like if required is &quot;Yes&quot; and
Taken is &quot;NO&quot; then explain in the comment box.
Now, I have the code that will check box is Required is yes
and Taken if taken is No.
I also have a code that will force the user to enter a comment if Required is yes and Taken is NO.
My problem has been and continue to be how to line this scenario up and box them nicely.
The whole Idea is when I query the database with an employee id, I want to be able to display the possition of the employee, the courses he/she is supposed to take, whether or not they are required and if they are required, have those courses been taken. If no why?
I have the sql codes to do this.
I just would greatly appreciate help in lining them up so it will be easy for management to know needs to take what course based on position and by looking at list of courses and checkboxes beside the course and below Required and Taken they can determine who has or has not taken the required courses and why.
Sorry for the long note. I just feel that the reason I have not gotten the correct response is because I am not explaining it well. There are great minds out there!!
 
Does not the table example above do what you want,unless im completely misunderstanding what you want.
To recap, create the table and properties, <TD> is the start of a cell and </TD> the end. Do this with all the values you want on the same row. <TR> tells it to move down so now your under the first cell etc etc. Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Hi GaryC123!
Sorry I was out in the field today.
Your code works to some extent.
The way your code is set up, it will have values in each cell.
<tr>
eg <td>value</d></tr>
then another value in another cell.
<tr>
<td>value</td></tr>
What I would like is to have this setup in one cell.
Something like:
<tr>
<td>
This will return: Required Taken
Into To DBO Yes Yes
SafetY Measures Yes No
SharePoint Admin No No etc.
</td>
</tr>

If this is not possible, then I will need to hide the cells or make the border 0 so that it would seem like the results are on one cell.
Thanks again to you and all those who have taken their time to help.


 
Putting everything in one cell will make it hard to line up everything. Use the table and put everything in its own cell and to remove the border use this -

<table border=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot; >

border=&quot;0&quot; means noone will be able see the table. Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top