Home > ASP Development > Form only passes data when it wants to?

Form only passes data when it wants to?



Very akward situation here...this was working just fine 2 weeks ago. When I came back to it now, it only works when certain letters are chosen. I checked to see the request method, and on the letters it works, it's what it should be (post) but on the letters it doesnt work, it uses the get request method. When I try changing the form method to get, it still doesn't work. I haven't tested them all, but the characters that work seem to be like every other (period, a, c, e).



Please help! This is important that it works...:-\



form code:


Code:


<form method="post" action="duplicate.asp?1=1">
First character: <select name="the_letter"><option value="46">.</option><%
For x = 97 To 122
Response.Write("<option value=""" & x & """>" & Chr(x) & "</option>")
Next
%></select><br />
Minimum match amount: <input name="min" style="width: 30px;" type="text" value="90" />%<br />
<button type="submit">Go</button> <button type="button" onClick="window.location = 'default.asp';">Back to Games Admin</button>
</form>




Processing code:


Code:


Response.Write(Request.ServerVariables("REQUEST_METHOD") & "<br />")
Response.Write("First letter: <b>" & letter & "</b><br />")
Response.Write("Min Match Amount: <b>" & Request("min") & "%</b><br /><br />")

Dim arr1, arr2, arr3, x, percent
percent = CDbl(Request("min")) / 100
x = 0

strSQL = "SELECT COUNT([ID]) AS [Total] FROM PSXGames WHERE LEFT([Name],1) = '" & letter & "';"
'strSQL = "SELECT COUNT([ID]) AS [Total] FROM PSXGames WHERE [Name] LIKE '%" & letter & "%';"
RS.Open strSQL, Conn
Total = RS("Total")
RS.Close()

ReDim arr1(Total)

strSQL = "SELECT Name FROM PSXGames WHERE LEFT([Name],1) = '" & letter & "' ORDER BY [Name] ASC;"
RS.Open strSQL, Conn
While Not RS.EOF
arr1(x) = RS("Name")

x = x + 1
RS.MoveNext()
Wend
RS.Close()

z = 2
Dim didsomething
didsomething = False

For i = 0 To Total
For y = 0 To Total
If i <> y Then
blah = CDbl(CompareString(arr1(i), arr1(y)))

If blah > percent Then
didsomething = True

' ReDim arr2(z)
' ReDim arr3(z)
' arr2(z) = arr1(i)
' arr2(z) = arr1(y)

d = 0

RS.Open "SELECT ID, Console FROM PSXGames WHERE Name = '" & Replace(arr1(i), "'", "''") & "';", Conn
While Not RS.EOF
d = d + 1
RS.MoveNext()
Wend

If d > 1 Then
RS.Close()
Response.Redirect("duplicate.asp?1=1&name=" & arr1(i))
Else
RS.MoveFirst()
iID = RS("ID")
iCon = RS("Console")
End If
RS.Close()

d = 0

RS.Open "SELECT ID, Console FROM PSXGames WHERE Name = '" & Replace(arr1(y), "'", "''") & "';", Conn
While Not RS.EOF
d = d + 1
RS.MoveNext()
Wend

If d > 1 Then
RS.Close()
Response.Redirect("duplicate.asp?1=1&name=" & arr1(y))
Else
RS.MoveFirst()
yID = RS("ID")
yCon = RS("Console")
End If
RS.Close()

If z Mod 2 = 1 Then
rows = rows & " <tr><td><button type=""button"" onClick=""window.location = 'default.asp?act=delete&action=delete&edit=" & iID & "';"">Delete</button><button type=""button"" onClick=""window.location = 'default.asp?action=edit&edit=" & iID & "';"">Edit</button> " & arr1(i) & " (" & ConsoleString(iCon) & ")</td><td style=""font-weight: bold;"">" & FormatToPercent(blah) & "</td><td align=""right"">" & arr1(y) & " (" & ConsoleString(yCon) & ") <button type=""button"" onClick=""window.location = 'default.asp?action=edit&edit=" & yID & "';"">Edit</button><button type=""button"" onClick=""window.location = 'default.asp?act=delete&action=delete&edit=" & yID & "';"">Delete</button></td><td><button type=""button"" onClick=""window.location = 'consolidate.asp?game1=" & iID & "&game2=" & yID & "';"">Consolidate</button></td></tr>" & vbCrLf
End If

z = z + 1
End If
End If
Next
Next

If didsomething Then
%>
<div style="margin-left: auto; margin-right: auto;">
<table align="center" border="1" width="100%">
<tr>
<th>Name 1</th>
<th>%</th>
<th>Name 2</th>
<th>Both</th>
</tr>
<%=rows%>
</table>
</div>
<%
Else
Response.Write("There were no matches. Possibly try a smaller minimum amount.")
End If



    
Guest


Response.Write("<option value=""" & x & """>" & Chr(x) & "</option>")



The value it seems to pass is number and not the letters. In the processesing form how do you manipulate this value.




Code:


Response.Write("First letter: <b>" & letter & "</b><br />")






How do you get this variable letter? Your code doesn't seem to have this part. can you post that as well?

Was this answer helpful ? Yes No   
Guest


Try this soultion. Pass the exact letter and not the number




Code:


 
Response.Write("<option value=""" & Chr(x) & """>" & Chr(x) & "</option>")




in the processing page directly use the value without any manipulation.


Code:



letter = Request.Form("the_letter")
Response.Write("First letter: <b>" & letter & "</b><br />")



Was this answer helpful ? Yes No   
Guest


I did both already...that's not the problem.

Was this answer helpful ? Yes No   
Guest


Please help guys...I don't know what's wrong with this.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved