Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2004, 11:42 PM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help, From question.....

Original page


<%
IF session("administrator_name") = "" THEN

response.redirect "../login/adlogin.asp"
response.end
END IF
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK
href="style.css" type=text/css rel=stylesheet>

<title></title>
</head>

<body background=../image/bg.gif>
<p align="center"></p>
<table background="#ffffff" align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800" id="AutoNumber1" height="400">
<tr>
<td width="100" height="441" VALIGN="TOP">
<align="left">
service management<BR>
<a href="client_order.asp">order management</a><BR>
N user management<BR>
user management<BR>
artical management<BR>
<a href="main_type_add.asp">main type add</a><BR>
<a href="main_type_list.asp">main type edit</a><BR>
<a href="artical_type_add.asp">artical type add</a><BR>
<a href="artical_type_list.asp">artical type edit</a><BR>
<a href="artical_add.asp">artical add</a><BR>
<a href="artical_type.asp">edit aritcal</a><br>
<a href="admin_user_manage.asp">system management</a><br>
<a href="admin_user_add.asp">add user</a><br>
<a href="admin_user_list.asp">user management</a>
</td>
</td>
<td valign=top width="713" height="441">
<p align="left">artical add</p>
<FORM action = "artical_add1.asp" method="POST">
<table border=0 height="395" align="left">
<tr>
<td align=right height="19">main type:</td>
<td><select name="main_type">
<%
set conn = DBConn()
on error resume next

sql="SELECT * from main_type order by main_type_id"
set rs=server.createobject("adodb.recordset")
Set rs=conn.Execute(sql)
do while not rs.eof
Response.Write "<option>"&rs("main_type_name")

rs.MoveNext
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</option>
</select>
</td>
</tr>
<tr>
<td align=right height="19">artical type:</td>
<td><select name="artical_type">
<%
set mconn = DBConn()
on error resume next
msql="SELECT * from artical_type order by artical_type_id"
set mrs=server.createobject("adodb.recordset")
Set mrs=mconn.Execute(msql)
do while not mrs.eof
Response.Write "<option>"&mrs("artical_type_name")
mrs.MoveNext
Loop
mrs.Close
Set mrs = Nothing
mconn.Close
Set mconn = Nothing
%>
</option>
</select></td>
</tr>
<tr>
<td align=right height="19">artical titel</td>
<td height="19"><input type="text" NAME="artical_title" size="70"></td>
</tr>
<tr><td valign=top align=right height="345">artical:</td>
<td height="345"><textarea warp=soft name="artical" rows=26 cols=69></textarea></td>
</tr>
<input type="SUBMIT" value="add">&nbsp&nbsp<input type="reset" value="reset">
</td>
</tr>
</table>
</FORM>
</td>
</tr>
</table>

</body>
</html>


auto select menu test pass

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
above insert <head></head>


<select name="first" onChange="MM_jumpMenu('parent',this,0)">
<%
sql="select main_type_id,main_type_name from main_type order by main_type_id"
set rs = DBconn.execute(sql)
if rs.eof or rs.bof then
response.write "<option>-----</option>"
else
while not(rs.eof or rs.bof)
response.write "<option value='?sec="&rs("main_type_id")&"'"
if cstr(rs("main_type_id")) = request.querystring("sec") then
response.write "selected"
end if
response.write (">" & rs("main_type_name") & "</option>")
rs.movenext
wend
rs.movefirst
end if
%>
</select>



<select name="second">
<%if rs.eof or rs.bof then
response.write ("<option>--------</option>")
else
if request.querystring("sec") = "" then
temp = rs("main_type_id")
else
temp = request.querystring("sec")
end if
subsql = "select * from artical_type where main_type_name='"&temp&"'"
set subrs = DBconn.execute(subsql)
if subrs.eof or subrs.bof then
response.write ("<option>-----</option>")

else
while not(subrs.eof or subrs.bof)
response.write "<option value='" & subrs("artical_type_name") & "'>"&subrs("artical_type_name")&"</option>"
subrs.movenext
wend
end if
end if


subrs.close
set subrs = nothing
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
</select>
It's doesn't display well when I use red word replace green word.. please help me, thank million!!!
 
Old November 18th, 2004, 12:03 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

What exactly is your problem? EG: line number, the exact error

Did DW put all those &nbsp; 's in there? - wow...

When you post a problem here for a quick helpful response just post the problematic part of the code, what the problem is and where you think the problem is (BTW:the browser does all this for you)

Wind is your friend
Matt
 
Old November 18th, 2004, 12:33 AM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

so sorry, because my english not very good, maybe I express my question not very clear.
I mean when i replace the green code use red code in the original page, the textbox and textarea can't display.. I don't know you can understand my mean?

 
Old November 18th, 2004, 01:17 AM
Registered User
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

haha, I found where wrong, conn.close, I write difference name Dbconn conn... anyway, thanks.....






Similar Threads
Thread Thread Starter Forum Replies Last Post
question maheshraju ASP.NET 2.0 Basics 3 March 13th, 2008 08:54 AM
Question Ashwini Classic ASP Databases 3 January 10th, 2006 07:20 AM
Question? Calibus Classic ASP Databases 8 August 6th, 2004 08:25 AM
a question gorji C++ Programming 2 August 11th, 2003 07:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.