HOME > ASP > ASP Forum > clear form หลังจากที่ submit แล้วทำยังไงค่ะ รบกวนขอคำแนะนำเกี่ยวกับเรื่องนี้หน่อยค่ะ ต้องการเคลียร์ค่าใน list menu หลังจากที่ได้ submit
clear form หลังจากที่ submit แล้วทำยังไงค่ะ รบกวนขอคำแนะนำเกี่ยวกับเรื่องนี้หน่อยค่ะ ต้องการเคลียร์ค่าใน list menu หลังจากที่ได้ submit
ต้องการเคลียร์ค่าใน list menu หลังจากที่ได้ submit form (กด ปุ่ม search) ไปแล้ว
แต่ว่าให้ค่าของการค้นหายังอยู่
โดยให้เคลียร์เฉพาะ form ทำยังไงด้วยวิธีไหนบ้างค่ะ
Set adocon = Server.CreateObject("ADODB.Connection") 'ประกาศตัวแปร adocon เป็นตัวแปร object connectio จะเรียก ,method open ที่ใช้ติดต่อฐาน DigitalLibrary.accdb
' strCon = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & server.MapPath("srieng02/wwwroot/DIGITALLIBRARY/DigitalLibrary2007.accdb") 'This one is for Access 2000/2002
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("DigitalLibrary2003.mdb") 'This one is for Access 2000/2002
' strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("srieng02\Engineer\DigitalLibrary\DigitalLibrary2003.mdb") 'This one is for Access 2000/2002
%>
<form action="search.asp" method="post" name="search" target="_self" id="search">
<table width="100%" border="0">
<tr>
<td><strong><font size="5"color="#0033FF">Document Search</font></strong>
<hr align="left" color="#333333" size="4" width="50%" > </td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td><strong> <strong><font color="#5CB900" size="4">Detail</font></strong>
</strong><strong></strong><strong></strong><strong></strong><strong></strong></td>
<td colspan="3"> </td>
<td colspan="2"><strong><font color="#5CB900" size="4">Link</font></strong><strong></strong></td>
</tr>
<tr>
<td width="14%"><strong><font size="2">Document Type</font></strong></td>
<td width="20%"> <strong><font color="#0000FF" size="4">
<select style='width=130px' id=Doc_type name=Doc_type >
<option><%=xDoctype%></option>
<%
xsql = "select distinct(doc_type) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by doc_type "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("doc_type")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
</font></strong>>
</td>
<td width="17%"><select style='width=120px' id=select3 name=subtype >
<option><%=xSubtype%></option>
<%
xsql = "select distinct(sub_type) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by sub_type "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("sub_type")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
>> </td>
<td width="15%"><select style='width=120px' id=select33 name=Subsubtype >
<option><%=xSubsub_type%></option>
<%
xsql = "select distinct(Subsub_type) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by Subsub_type "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("Subsub_type")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select> <font size="2"> </font><font size="2"> </font><font size="2"> </font><font size="2"> </font></td>
<td><font size="2"> <strong>Area</strong></font></td>
<td width="22%" colspan="2"><font size="2">
<select style='width=180px' id=select27 name=Area>
<option><%=xArea%></option>
<%
xsql = "select distinct(link_key) "
xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'AREA' or link_type is null) "
xsql = xsql & " order by link_key "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
Do While Not rx.EOF
%>
<option><%=rx("link_key")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
</font></td>
</tr>
<tr>
<td><strong><font size="2">Project Number</font></strong></td>
<td colspan="3"><select style='width=316px' id=select34 name=Project >
<option><%=xProject%></option>
<%
xsql = "select distinct(project) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by project "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("project")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select> <font size="2"> </font><font size="2"> </font><font size="2"> </font></td>
<td width="12%"><font size="2"> <strong>Unit</strong></font></td>
<td colspan="2"><font size="2">
<select style='width=180px' id=select26 name=unit>
<option><%=xUnit%></option>
<%
xsql = "select distinct(link_key) "
xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'UNIT' or link_type is null) "
xsql = xsql & " order by link_key "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("link_key")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
</font></td>
</tr>
<tr>
<td height="29"><strong><font size="2">Creator</font></strong></td>
<td><select style='width=130px' id=Creator name=Creator >
<option><%=xCreator%></option>
<%
xsql = "select distinct(creator) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by creator "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("creator")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select></td>
<td colspan="2"><select style='width=120px' id=select18 name=Vendor >
<option><%=xVendor%></option>
<%
xsql = "select distinct(vendor) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by vendor "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("vendor")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select> <font size="2"> </font><font size="2"> </font></td>
<td><font size="2"> <strong>Tag type</strong></font></td>
<td colspan="2"><font size="2">
<select style='width=180px' id=select36 name=Tagtype>
<option><%=xTagtype%></option>
<%
xsql = "select distinct(link_key) "
xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'TAG_TYPE' or link_type is null)"
xsql = xsql & " order by link_key "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
Do While Not rx.EOF
%>
<option><%=rx("link_key")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
</font></td>
</tr>
<tr>
<td><strong><font size="2">Document Number</font></strong></td>
<td colspan="3"><select name=doc_number id=select35 style='width=316px' >
<option><%=xDoc_number%></option>
<%
xsql = "select distinct(doc_number) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by doc_number "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("doc_number")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select> <font size="2"> </font><font size="2"> </font></td>
<td><font size="2"> <strong>Tag</strong></font></td>
<td colspan="2"><font size="2">
<select style='width=180px' id=select36 name=Tag>
<option><%=xTag%></option>
<%
xsql = "select distinct(link_key) "
xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'TAG' or link_type is null) "
xsql = xsql & " order by link_key "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("link_key")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
</font></td>
</tr>
<tr>
<td><strong><font size="2">Title</font></strong></td>
<td colspan="3"><select name=Title id=Title style='width=482px'>
<option><%=xTitle%></option>
<%
xsql = "select distinct(title) "
xsql = xsql & " from s_elib_docmast "
xsql = xsql & " order by title "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
rx.MoveFirst
Do While Not rx.EOF
%>
<option><%=rx("title")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select> <font size="2"> </font><font size="2"> </font></td>
<td><font size="2"> <strong>Manufacturer</strong></font></td>
<td colspan="2"><font size="2">
<select style='width=180px' id=select30 name=Manuf>
<option><%=xManuf%></option>
<%
xsql = "select distinct(link_key) "
xsql = xsql & " from s_elib_doclink where inuse ='T' and (link_type = 'MANUF' or link_type is null)"
xsql = xsql & " order by link_key "
Set rx = Server.CreateObject("ADODB.Recordset")
rx_SQL = xsql
rx.Open rx_SQL, strCon,1,3
If rx.RecordCount <> 0 Then
Do While Not rx.EOF
%>
<option><%=rx("link_key")%></option>
<%
rx.Movenext
Loop
rx.close
End if
%>
</select>
</font></td>
</tr>
<tr>
<td><strong><font size="2">Date : from : to</font></strong></td>
<td colspan="3"> <input name id="Date1"="Date1" type="text" size="10" maxlength="10">
<a href="JavaScript:;" onClick="toggleCalendar('Date1')" > <img border="0" src="formcal.gif" width="16" height="16"></a>
<input id="Date2" name="Date2" type="text" size="10" maxlength="10">
<a href="JavaScript:;" onClick="toggleCalendar('Date2')"><img border="0" src="formcal.gif" width="16" height="16"></a>
<TABLE bgColor=#ffffff border=1 cellPadding=0 cellSpacing=3 id=calendar style="DISPLAY: none; POSITION: absolute; Z-INDEX: 4">
<TBODY>
<TR>
<TD colSpan=7 vAlign=center>
<!-- Month combo box -->
<SELECT id=month onchange=newCalendar()>
<SCRIPT language=JavaScript>
// Output months into the document.
// Select current month.
for (var intLoop = 0; intLoop < months.length; intLoop++)
document.write("<OPTION " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]);
</SCRIPT>
</SELECT>
<!-- Year combo box -->
<SELECT id=year onchange=newCalendar()>
<SCRIPT language=JavaScript>
// Output years into the document.
// Select current year.
for (var intLoop = 1900; intLoop < 2028; intLoop++)
document.write("<OPTION " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop);
</SCRIPT>
</SELECT>
</TD>
</TR>
<TR class=days>
<!-- Generate column for each day. -->
<SCRIPT language=JavaScript>
// Output days.
for (var intLoop = 0; intLoop < days.length; intLoop++)
document.write("<TD>" + days[intLoop] + "</TD>");
</SCRIPT>
</TR>