Kan någon förklara varför problem uppstår med checkboxar i XP? Scriptet nedan fungerar bra i 2000 men går inte i XP. Varför? <code>Checkbox i XP.
<%
f20= request.form("f20")
Function FQ( thestring )
FQ = REPLACE( thestring, "'", "''" )
End Function
Function Checkbox(v)
if v = "on" then
Checkbox = true
else
Checkbox = false
end if
end Function
f20= FQ(TRIM(Checkbox(f20)))
Set Con=Server.CreateObject("ADODB.Connection")
Set Rs=Server.CreateObject("ADODB.Recordset")
con.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("test.mdb")&";pwd="
SQL="SELECT * FROM Table1 Where 1=2"
Rs.Open SQL,Con,1,2
Rs.AddNew
rs("f20")= f20
Rs.Update
Rs.Close
Con.Close
Set Rs = Nothing
Set Con = Nothing
response.redirect "test3.asp"
%>Sv: Checkbox i XP.
<%
Function FQ( thestring )
FQ = REPLACE(thestring, "'", "''")
End Function
Function Checkbox(Value)
If LCase(Trim(Value)) = "on" then
Checkbox = True
Else
Checkbox = False
End If
End Function
f20 = Request.Form("f20")
Set Con = Server.CreateObject("ADODB.Connection")
con.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("test.mdb")&";pwd="
strSQL = "SELECT * FROM Table1 WHERE 1 = 2"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open strSQL, Con, 1, 2
Rs.AddNew
rs("f20") = Checkbox(f20)
Rs.Update
Rs.Close
Set Rs = Nothing
Con.Close
Set Con = Nothing
Response.Redirect "test3.asp"
%>
</code>