Home > front end >  Asp dynamic form ID to the database with checkboxes for batch add problems
Asp dynamic form ID to the database with checkboxes for batch add problems

Time:10-13

Made a dynamic form and add the check button front, plus the text field (pictured), used in the batch submit search content to watch tb_user in tz column corresponding to the id, the processing page can accept to the front desk page id, here is my handle code page:
Consult 1, the front desk page of text fields with ID binding?
Can receive 2, the background to the ID, can batch delete, modify in batch to UPDATE syntax errors,

<% @ LANGUAGE="VBSCRIPT" CODEPAGE="936" % & gt;
<%
Datafile="data/user. The MDB connstr"=". The Provider=Microsoft Jet. The OLEDB. 4.0; Data Source="& amp; Server. MapPath (" "& amp; Datafile&"
")Set the conn=Server. CreateObject (" ADODB. Connection ")
Conn. Open ConnStr
%>
<%
Id=Trim (Request (" Checkdel "))
If id="" then
Response. Write a response. The end
End the if
Id=split (id, ", ", 1, 1)
For I=0 to UBound (id)
Conn. Execute (" update tb_user set tz="& amp; HitRate&" Where id="& amp; Id (I))
Next
The Response. Redirect "index. The asp
"Conn. Close
Set the conn=nothing
%>

CodePudding user response:

CodePudding user response:

How specific error?

Because you are cycle,
If we can capture the specific SQL error which line, so, in the database, analyse,

<script type="text/javascript" language="javascript" & gt;
The function fun (bill_id) {//pop-up Windows
Obj=document. GetElementsByName (" order_ids ");
Check_val=[];
For (k in obj) {
If (obj [k]. Checked)
Check_val. Push (obj [k]. Value);
}

If (check_val=="") {
Alert (" please check the order first!" );
return false; }

Var detail=window. The open (".. 1/orderManage Detail_list asp? IsExport=no& Bill_id bill_id="+ +" & amp; Order_ids="+ check_val," detail ", "height=900, width=780, top=0, left=1500, the status=yes, toolbar=yes, menubar=no, location=yes, alwaysRaised=yes, z - look=yes");
}
</script>




I the above code, is through the check, to pass parameters, first JS judgment, which order_ids are checked, and the value value of JS take order_ids,


I understood your question:

Check box ID, and match them with the INPUT binding is?
Very simple, put them together with a & lt; Form> , a line of a pair, there are a lot of to a page,

CodePudding user response:

refer to the second floor ps800 response:
how specific error?

Because you are cycle,
If we can capture the specific SQL error which line, so, in the database, analyse,

<script type="text/javascript" language="javascript" & gt;
The function fun (bill_id) {//pop-up Windows
Obj=document. GetElementsByName (" order_ids ");
Check_val=[];
For (k in obj) {
If (obj [k]. Checked)
Check_val. Push (obj [k]. Value);
}

If (check_val=="") {
Alert (" please check the order first!" );
return false; }

Var detail=window. The open (".. 1/orderManage Detail_list asp? IsExport=no& Bill_id bill_id="+ +" & amp; Order_ids="+ check_val," detail ", "height=900, width=780, top=0, left=1500, the status=yes, toolbar=yes, menubar=no, location=yes, alwaysRaised=yes, z - look=yes");
}
</script>




I the above code, is through the check, to pass parameters, first JS judgment, which order_ids are checked, and the value value of JS take order_ids,


I understood your question:

Check box ID, and match them with the INPUT binding is?
Very simple, put them together with a & lt; Form> , a line of a pair, there are a lot of to a page,


I want to do is a data entry page, the content of the entry is on dynamically generated according to the results of a query form corresponding

CodePudding user response:

Today try to text field is modified to
To view the page source code is:
HitRate28 \ HitRate29 \ HitRate30, how three values this batch written to the database?

CodePudding user response:

reference 5 building next to the old also reply:
today try to text field is modified to
To view the page source code is:
HitRate28 \ HitRate29 \ HitRate30, how three values this batch written to the database? nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • ASP
  • Related