Forum Moderators: open
1. the first field Ticket Id is suppose to increment by itself but it doesn't
2. When I hit submit it does not add the records into my database, I have checked all the settings, checked to make sure that I am pointing to the right database and small stuff like that.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="../system/cmsopen.asp"-->
<!--#include file="../system/fn_authentication.asp"-->
<!--#include file="../system/functions.asp"-->
<HTML>
<HEAD>
<title>
<%=pageTitle%>
</title>
<%
pageTitle="Report Request"
basepath="../"%>
<link href="../css/standard.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript">
<!--
function closeWindow()
{
window.confirm("Do you want to submitt the form?");
}
//-->
</script>
</HEAD>
<body id="parFont" bgcolor="#eaeaea">
<!--#include file="../layout/pagestart.asp"-->
<%
Dim con, sql
Response.Write "Request Method = " & Request.ServerVariables("REQUEST_METHOD") & "<br><br>"
Response.Write "Form name ¦ Value"
for each item in request.form()
response.write item & " ¦ " & request.form(item) & "<br>"
next
'response.end
if request.form("submit") = "Submit" then
Set con = Server.CreateObject("ADODB.Connection")
con.Open Application("CMSConn")
strRequestorName = request.form("Requestorname")
strRequestorEmail = request.form("RequestorEmail")
strPhone = request.form("Phone")
strDescription = request.form("Description")
strRequestedDate = request.form("RequestedDate")
strTurnoverDate = request.form("TurnoverDate")
strRequestingDept = request.form("RequestingDept")
strTypeofRequest = request.form("TypeofRequest")
strTypeofAging = request.form("TypeofAging")
strAssigneeName = request.form("AssigneeName")
strCompletedDate = request.form("CompletedDate")
strStatus = request.form("Status")
SQL = "INSERT INTO cwm_Report_Request_Form" & _
" VALUES('" & strRequestorName & "', '" & strRequestorEmail & "', '" & strPhone & "', '" & strDescription & "', '" & strRequestedDate & "', '" & strTurnoverDate & "', '" & strRequestingDept & "', '" & strTypeofRequest & "', '" & strTypeofAging & "', '" & strAssigneeName & "', '" & strcompleteddate & "', '" & strStatus & "')"
response.Write(SQL)
''response.End
con.execute(SQL)
con.Close
Set con = Nothing
end if
%>
<form name="ReportRequest" action="<%=basepath%>Admin/reportrequest.asp" enctype="multipart/form-data" method="Post" ID="Form1" >
<table id="parfont" cellspacing="1" cellpadding="2">
<tr>
<td>Ticket Id:</td>
<td><input type="text" name="TicketId" size="40" maxlength="255"></td>
</tr>
<tr>
<td>Requestor Name:</td>
<td><input type="text" name="RequestorName" size="40" maxlength="255" value="Amber"></td>
</tr>
<tr>
<td>Requestor Email:</td>
<td><input type="text" name="RequestorEmail" size="40" maxlength="255"></td>
</tr>
<tr>
<td>Phone</td>
<td><input type="text" name="Phone" size="40" maxlength="255"></td>
</tr>
<tr>
<td>Requesting Department:</td>
<td><select name="dept">
<option value="select" selected>Select</option>
<option value="global">Global</option>
<option value="national">National</option>
<option value="regional">Regional</option>
<option value="resellers">Resellers</option>
<option value="Government">Government</option>
<option value="Agency">Agency</option>
</select></td>
</tr>
<tr>
<td>Description</td>
<td><input type="text" name="Description" size="40" maxlength="255"></td>
</tr>
<tr>
<td>DateRequested</td>
<td><input type="text" name="DateRequested" size="40" maxlength="255"></td>
</tr>
<tr>
<td>TurnOverDate</td>
<td><input type="text" name="TurnOverDate" size="40" maxlength="255"></td>
</tr>
<tr>
<td>Status</td>
<td><select name="Status">
<option value="None" selected>Select One</option>
<option value="Open">Open</option>
<option value="Hold">Hold</option>
<option value="WaitingCustomerInput">WaitingInput</option>
<option value="Closed">Closed</option>
</select></td>
</tr>
<tr>
<td>CompletedDate</td>
<td><input type="text" name="CompletedDate" size="40" maxlength="255"></td>
</tr>
<tr>
<td>AssignedName</td>
<td><select name="AssignedName">
<option value="Null" selected>Select One</option>
<option value="AmberAhmed">Amber Ahmed</option>
<option value="NancyTobin">Nancy Tobin</option>
<option value="ScottWishkoski">Scott Wishkoski</option>
</select></td>
</tr>
<tr>
<td>Output Link</FONT></td>
<td><input maxlength="40" size="40" name="OutputLink"></td>
</tr>
<tr>
<td>Please provide details on the request:</td>
<td><textarea name="Details" rows="5" cols="25" maxlength="400"></textarea></td>
</tr>
<tr>
<td>Type of Aging</td>
<td><input type="radio" value="standard" name="aging" CHECKED>Standard <input type="radio" value="every30" name="aging">
30,60,90 Every 30 <input type="radio" value="monthly" name="aging">ARCS/Monthly
</td>
</tr>
<TR>
<TD></TD>
<TD></TD>
</TR>
<tr>
<td>Type of Request</td>
<td><select name="TypeofRequest">
<option value="select" selected>Select</option>
<option value="AddData">AddData</option>
<option value="Aging">Aging</option>
<option value="CollectorReporting">CollectorReporting</option>
<option value="DSO">DSO</option>
<option value="Segmentation">Segmentation</option>
<option value="Targets">Targets
</option>
</select></td>
</tr>
<TR>
<TD></TD>
<TD></TD>
</TR>
<tr>
<td>Pick a file to upload:</td>
<td><input type="file" name="test" size="50" ID="File1"></td>
</tr>
<TR>
<TD></TD>
<TD></TD>
</TR>
<tr>
<td></td>
<td><input type="button" name="cancel" value="Cancel" ID="Button1">
<!---input onclick= "closeWindow();" type= "submit" name="submit12" value=" Save " ID="Submit"-->
<input type="submit" name="submit" value="Submit" ID="Button1">
</td>
</tr>
</table>
</form>
<p>
This system requires user identification. Please logon first.<br>
[ <a id="parLink" href="logon.asp">Click here to proceed to logon screen</a> ]
</p>
<!--#include file="../system/cmsclose.asp"-->
</body>
</HTML>
can anyone please help me figure out why it will not increment and why it will not submit the records in my table.
strRequestorName = request.form("Requestorname")Do you need one these to capture the submit?
With PHP this would look like this - $submit = $_POST["submit"].
If that isn't the problem, then I would look a hard look at the form action.
[edited by: smells_so_good at 7:59 pm (utc) on Aug. 23, 2006]
Try reading up on the Randomize and RND() functions in ASP if u want to go down the Random basket number route.
One advantage of doing this is that you dont start off with insanely small ID's which appear a little 'strange' to users - unless of course you start your id at say 100000.