ASP pages, how to submit without refreshing the page check box in the case?

As shown in Fig.


ASP webpage, when the bill received money on the point of "receivables" check box.
In the page without refreshing the circumstances, how to submit to the server?
Also, this page in addition to the ordinary computer browsing, another is often used in the Android mobile phone to browse this page. There should be no effect?

The following code

<!--#include file="Conn2.asp"-->

<html>
<head>

<%

function sumzonger(str)
set rs2=server.CreateObject("adodb.recordset")
rs2.Open "select SUM(zonger) as zonger2 from chuhuo where chuhuodan='" & Replace(str, "'","''") & "'",conn2,1,1
if not rs2.eof then
sumzonger=rs2("zonger2")
else
sumzonger=""

end if

rs2.Close
set rs2=nothing
end function

function getdanwei(str)
set rs2=server.CreateObject("adodb.recordset")
rs2.Open "select danwei from chanpin where _identify="&str,conn2,1,1
if not rs2.eof then
getdanwei=rs2("danwei")
else
getdanwei=""
end if

rs2.Close
set rs2=nothing
end function

%>


<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>

<style type="text/css">
<!--
body {
background-color: #ced7f7;
}
.STYLE3 {font-size: 15px}
.STYLE5 {
font-size: 36px;
font-weight: bold;
}
-->
</style></head>


<div align="center"><span class="STYLE5">Out of order</span>

</div>
<P>

<table width="562" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>

<td width="100" height="22" align="center"><span class="STYLE3">Date of shipment</span></td>
<td width="96" align="center">Out of order</td>
<td width="192" height="22" align="center">Unit name</td>
<td width="91" height="22" align="center">Amount of money</td>
<td width="71" height="22" align="center">Receivables</td>
</tr>

<%


'Start page
MaxPerPage=30
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=int(request("page"))
else
currentPage=1
end if

set rs=server.CreateObject("adodb.recordset")
sql="select * from chuhuodan where _identify>0 "

if kehuid<>"" then
kehuid="kehuid"
end if

sql=sql&" order by _identify desc"
rs.open sql,conn2,1,1


if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> Sorry, the relevant information is not found!</p>"
else
totalPut=rs.recordcount

if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if

if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"shoukuan.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"shoukuan.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"shoukuan.asp"
end if
end if
end if

sub showContent
dim i

i=0
do while not rs.eof


%>
<tr>

<td height="22" align="center"><span class="STYLE3"><%=rs("chuhuodate")%></span></td>
<td align="left"><%=rs("chuhuodan")%></td>
<td height="22" align="left"><%=rs("kehuname")%></td>
<td height="22" align="left"><%=sumzonger(rs("chuhuodan"))%></td>
<td height="22" align="center"><%=rs("wancheng")%><form name="form1" method="post" action=""><input type="checkbox" name="checkbox" value="checkbox"></form>
</td>
</tr>
<%i=i+1

if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing%>
</table>


<% End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n

If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If

Response.Write "<form method=Post action="&filename&"?selectm="&selectm&"&selectkey="&selectkey&" >"
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>Home page</font> "
Else
Response.Write "<a href="&filename&"?page=1&tel="&tel&" class='contents'>The home page</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&tel="&tel&" class='contents'>On one page</a> "
End If

If n-currentpage<1 Then
Response.Write "<font class='contents'>The next page at</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&tel="&tel&" class='contents'>"
Response.Write "The next pages </a> <a href= "& filename&" page= "? & n&" & "; tel= & tel& class='contents'> end"</a>"
End If
Response.Write "<font class='contents'> Page: </font> <font "class='contents'> & CurrentPage& </font> <" font class='contents'> "; / & n&".</font> "
Response.Write "<font class='contents'> There are "& totalnumber&" records "
Response.Write "<font class='contents'>Go to the: </font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"
Response.Write "&nbsp;<input type='submit' class='button' value='GO' name='cndok'></form>"
End Function
%>


</html>

Started by Daisy at February 06, 2016 - 11:34 PM

With Ajax, lazy to write JS code using jquery
save.asp
<%
id=request("id")
'=======According to the ID update records
response.write "1"
%>



<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)},
success:function(data){if(data=='1')alert('Successfully saved '); else alert (' save failed!\n'+data)}
})
}
</script>
<form name="form1" method="post" action=""><input type="checkbox" name="checkbox" value="checkbox" onclick="ajaxPost(<%=rs("The ID field records")%>)"></form>

Posted by Perry at February 17, 2016 - 11:45 PM

The response to 2013-09-15 09:04:34 was removed by the administrator

Posted by Ailsa at February 19, 2016 - 12:00 AM

Thank you showbo webmaster!
See a little bit of hope. But the operation is not successful.


The main lines of field is _identify
The following code:
<script>
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)},
success:function(data){if(data=='1')alert('Successfully saved '); else alert (' save failed!\n'+data)}
})
}
</script>
<form name="form1" method="post" action=""><input type="checkbox" name="checkbox" value="checkbox" onclick="ajaxPost(<%=rs("_identify")%>)"></form>

Also hope the exhibitions!

Posted by Daisy at February 23, 2016 - 12:46 AM

In addition
data:{id:id},
type:'POST',
dataType:'text',
Datatype can use int?
dataType:'int',

Posted by Daisy at March 04, 2016 - 1:00 AM

Remove other HTML code, see me for example

<%
id=request("id")
'=======According to the ID update records
response.write "1"
%>

Posted by Perry at March 10, 2016 - 1:39 AM

Still don't understand.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)},
success:function(data){if(data=='1')alert('Successfully saved '); else alert (' save failed!\n'+data)}
})
}
</script>
<form name="form1" method="post" action=""><input type="checkbox" name="checkbox" value="checkbox" onclick="ajaxPost(<%=rs("_identify")%>)"></form>


The save.asp page


<!--#include file="conn2.asp"-->

<%
id=request("id")
set rs2=server.CreateObject("adodb.recordset")
rs2.Open "select * from chuhuodan where _identify='"&id&"'",conn2,1,3
rs2("wancheng")=0
rs2.Update
rs2.movenext
rs2.Close
set rs2=nothing
%>

The operation results

Posted by Daisy at March 17, 2016 - 1:53 AM


Ajax ah

Posted by Cornell at November 12, 2016 - 7:55 PM

Respectfully, continue to wait for the results.

Posted by Daisy at November 19, 2016 - 8:04 PM

The landlord can not seriously look at the code, the response.write output less

<!--#include file="conn2.asp"-->
<%
id=request("id")
set rs2=server.CreateObject("adodb.recordset")
rs2.Open "select * from chuhuodan where _identify='"&id&"'",conn2,1,3
rs2("wancheng")=0
rs2.Update
rs2.movenext
rs2.Close
set rs2=nothing

response.Clear'Clear the contents before
response.Write 1
response.End'Output disable the following
%>

Posted by Perry at December 02, 2016 - 8:15 PM

A pop-up window is in the way. But how to clear the pop-up window.?
Deletion of success:function (data) {if (data=='1') alert (' save success'); else alert ('save failed! \n'+data)}.
Deletion of {if (data=='1') alert (' save success'); else alert ('save failed! \n'+data)}.
Delete the save.asp page response.Clear'clearance before the contents of the response.Write 1 response.End' Output Disable behind the content page.

Posted by Daisy at December 08, 2016 - 8:22 PM

Want to clear the prompt box
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)},
success:function(data){if(data=='1')alert('Successfully saved '); else alert (' save failed!\n'+data)}
})
}



This success
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)},
success:function(data){}
})
}




So there is no success
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)},
success:function(data)
})
}

Why is it?

Posted by Daisy at December 19, 2016 - 9:18 PM

I go to school the next JS.. Very basic things
function ajaxPost(id){
$.ajax({
url:'save.asp',
data:{id:id},
type:'POST',
dataType:'text',
error:function(xhr){alert('Error \n'+xhr.responseText)}
})
}

Posted by Perry at December 24, 2016 - 9:42 PM

The last line does not need a comma.
Thank you showbo webmaster! I have to learn JS.
But it does not solve the problem.
The program can run. In a test machine is running.
But the program moved to is not on the server. The reason is not linked server network.
Should this thing is caused by
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
What is this? Similar to drive it?

The server cannot network, but the network client can, when a client loading webpage not gave this to visit it?
The specific reasons.?
If not it can only use JavaScript to write?

Posted by Daisy at January 01, 2017 - 10:10 PM

The download, your code for you to download the file path on the line.

Posted by Buck at January 14, 2017 - 10:23 PM

The response to 2013-09-19 14:14:03 was removed by the administrator

Posted by Pauline at January 14, 2017 - 11:16 PM