By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 2,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

Strange Results w/ Form page POST Method

P: n/a
I'm using the POST method to submit a simple form html page with yes/no

and checkbox fields to an asp response page which stores the values in
a new dim string, then uses it to build a new table using ADO. I'm
getting sometimes correct values, sometimes null values (when I know I
pass a valid default value) and other times multiple values! I know
what the values coming over are because I do a response.write to see it

before the error appears. The errors that I get are multistep value
errors or more commonly data type value errors. For example, a field is

set with a 0 for No, or a 1 for Yes is supposed to send a "0" by
default. In some fields it does, in others it sends a null value, still

others it sends a "0,1". Both values!

There are no hidden fields in the form.
Has anyone seen this bizarre behavior and/or know what may be causing
it? I'm stumped.
Here is the form code. It is an .html file. (the response code asp page
is also listed way below)
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Hire Setup</title>
</head>

<body>

<form method="POST" name="NewHire" action=NewHireConfirmation_dev.asp>
<p><font face="Arial"><b>New Associate Setup Request</b></font></p>
<p><font face="Arial" size="2" color="#800000">Requester's Network
ID</font>
<input type="text" name="NetID" size="8"><br>
<font size="1" face="Arial">(First 7 letters of last name + 1 initial
of first
name)</font></p>
<p><font face="Arial" size="2" color="#800000">Basic Information -
New Hire</font></p>
<div align="left">
<table border="0" bordercolorlight="#800000">
<tr>
<td>*</td>
<td>First Name</td>
<td><input name="FirstName" size="20" ></td>
<td></td>
<td>Hire Date - <font color="#FF0000">mm/dd/yy</font></td>
<td><input name="HireDate" size="8" ></td>
</tr>
<tr>
<td>*</td>
<td>Last Name</td>
<td><input name="LastName" size="20" ></td>
<td>*</td>
<td>Out of Training Date - <font
color="#FF0000">mm/dd/yy</font></td>
<td><input name="OnFloorDate" size="8" ></td>
</tr>
<tr>
<td>*</td>
<td>Department</td>
<td><select size="1" name="Department">
<option>Account Management</option>
<option>Banking</option>
<option>Business Management</option>
<option>Computer Operations</option>
<option>Control</option>
<option>Data Entry</option>
<option>Facilities</option>
<option>Finance</option>
<option>Gen. and Admin.</option>
<option>HRizon Support</option>
<option>Human Resources</option>
<option>Implementation</option>
<option>LAN Support</option>
<option>MAilroom</option>
<option>Tech Support</option>
<option>Management Reports</option>
<option>MBA Support</option>
<option>Operations</option>
<option>Prelist</option>
<option>Production</option>
<option>Quality Control</option>
<option>Receptionist</option>
<option>Sales</option>
<option>Solution Center</option>
<option>Telecommunications</option>
<option>Teledata</option>
<option>Traffic</option>
<option>Training</option>
<option>Verification</option>
<option>Warehouse</option>

&nbsp;
</select></td>
<td>*</td>
<td>Add or Replace (To Staff)</td>
<td><select size="1" name="HireStatus">
<option selected>Add

<option>Replace
</select></td>
</tr>
<tr>
<td>*</td>
<td>Office</td>
<td><select size="1" name="Office">
<option selected>Boston

<option>Clifton

<option>Ft. Washington

<option>Long Island

<option>Milford

<option>Princeton
</select></td>
<td>*</td>
<td>New Hire or Transfer</td>
<td><select size="1" name="HireType">
<option selected>New Hire

<option>Transfer
</select></td>
</tr>
<tr>
<td></td>
<td>Telecommuter</td>
<td><select size="1" name="TelecommuteSwitch">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td></td>
<td>Will Report To</td>
<td><input name="NewHireManager" size="20" ></td>
</tr>
<tr>
<td></td>
<td>Title</td>
<td><input type="text" name="Title" size="20"></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
<hr>
<table border="0" width="100%">
<tr>
<td width="100%">LAN - <font face="Arial" size="2"
color="#800000">Please select all required hardware,
accounts and
software</font>
<table border="0">
<tr>
<td align="center" width="100"
bgcolor="#C0C0C0"><b>Hardware</b></td>
<td align="center" width="100" bgcolor="#C0C0C0">Laptop</td>
<td align="center" width="100" bgcolor="#C0C0C0">Desktop</td>
<td align="center" width="100"
bgcolor="#C0C0C0">SecurID/uunet</td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
<tr>
<td align="center" width="100"></td>
<td align="center" width="100">
<select size="1" name="LANHWLaptop">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANHWDesktop">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANHWSecureID">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
<tr>
<td align="center" width="100"
bgcolor="#C0C0C0"><b>Accounts</b></td>
<td align="center" width="100" bgcolor="#C0C0C0">E Mail ID</td>
<td align="center" width="100" bgcolor="#C0C0C0">RightFAX #</td>
<td align="center" width="100" bgcolor="#C0C0C0">PMF-PC</td>
<td align="center" width="100" bgcolor="#C0C0C0">RSVP ID</td>
<td align="center" width="100" bgcolor="#C0C0C0">PEAK</td>
</tr>
<tr>
<td align="center" width="100"></td>
<td align="center" width="100">
<select size="1" name="LANACCTEmail">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANACCTRightFax">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANACCTPMF">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANACCTPMF">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANACCTPEAK">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
</tr>
<tr>
<td align="center" width="100"
bgcolor="#C0C0C0"><b>Accounts</b></td>
<td align="center" width="100" bgcolor="#C0C0C0">Netware</td>
<td align="center" width="100" bgcolor="#C0C0C0">NT</td>
<td align="center" width="100" bgcolor="#C0C0C0">Access</td>
<td align="center" width="100" bgcolor="#C0C0C0">&nbsp;</td>
<td align="center" width="100" bgcolor="#C0C0C0">&nbsp;</td>
</tr>
<tr>
<td align="center" width="100"></td>
<td align="center" width="100">
<select size="1" name="LANACCTNetWare">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANACCTNT">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANACCTAccess">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
<tr>
<td align="center" width="100"
bgcolor="#C0C0C0"><b>Software</b></td>
<td align="center" width="100" bgcolor="#C0C0C0">PCPW</td>
<td align="center" width="100" bgcolor="#C0C0C0">HRizon</td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
<tr>
<td align="center" width="100"></td>
<td align="center" width="100">
<select size="1" name="LANSWPCPW">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="LANSWHRizon">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<table border="0" width="100%">
<tr>
<td width="100%">Telecommunications - <font face="Arial" size="2"
color="#800000">Please select all required
hardware and software</font>
<table border="0">
<tr>
<td align="center" width="100"
bgcolor="#C0C0C0"><b>Hardware</b></td>
<td align="center" width="100" bgcolor="#C0C0C0">Phone</td>
<td align="center" width="100"
bgcolor="#C0C0C0">Headset</td>
<td align="center" width="100" bgcolor="#C0C0C0">Cell
Phone</td>
<td align="center" width="100" bgcolor="#C0C0C0">Pager</td>
<td align="center" width="100" bgcolor="#C0C0C0">800 #</td>
</tr>
<tr>
<td align="center" width="100"></td>
<td align="center" width="100">
<select size="1" name="TELECOMHWPhone">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="TELECOMHWHeadset">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="TELECOMHWHeadset">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="TELECOMHWPager">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100">
<select size="1" name="TELECOMHW800">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
</tr>
<tr>
<td align="center" width="100"
bgcolor="#C0C0C0"><b>Software</b></td>
<td align="center" width="100"
bgcolor="#C0C0C0">CenterVu</td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
<tr>
<td align="center" width="100"></td>
<td align="center" width="100">
<select size="1" name="TELECOMSWAvaya">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
<td align="center" width="100"></td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<table border="0" width="100%">
<tr>
<td width="100%">Mainframe - <font face="Arial" size="2"
color="#800000">Please select all required
accounts</font>
<table border="0">
<tr>
<td width="100" align="center"
bgcolor="#C0C0C0"><b>Accounts</b></td>
<td width="100" align="center" bgcolor="#C0C0C0">RACF
ID</td>
<td width="100" align="center" bgcolor="#C0C0C0">IDLX
ID</td>
</tr>
<tr>
<td width="100" align="center"></td>
<td width="100" align="center">
<select size="1" name="MFACCTRACF">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
<td width="100" align="center">
<select size="1" name="MFACCTIDLX">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<table border="0" width="100%">
<tr>
<td width="100%">Facilities - <font face="Arial" size="2"
color="#800000">Please select all required
services</font>
<table border="0">
<tr>
<td width="100" align="center"
bgcolor="#C0C0C0"><b>Services</b></td>
<td width="100" align="center"
bgcolor="#C0C0C0">Passcard</td>
</tr>
<tr>
<td width="100" align="center"></td>
<td width="100" align="center">
<select size="1" name="FACSVCSPasscard">
<option selected value="0">No</option>
<option value="1">Yes</option>
</select></td>
</tr>
</table>
</td>
</tr>
</table>
<p><font face="Arial" size="2" color="#800000">Please enter any
special request or
requirements not addressed above</font></p>
<p><TEXTAREA cols=54 name=SpecialRequest rows=5></TEXTAREA></p>
<p><input type="submit" value="Submit"><input type="reset"
value="Reset" name="B2"></p>
</form>

</body>

</html>
RESPONSE PAGE (.ASP)

<html>

<head>
<title>New Hire Registration Confirmation</title>
<style fprolloverstyle>A:hover {color: #FF0000}</style>
</head>

<body vlink="#0000FF">
<!-- #INCLUDE FILE="adovbs.inc" -->

<%
dim oConn
dim oRSLANDATA
dim strSQL
dim strNetID
dim strFirstName
dim strLastName
dim strDepartment
dim strOffice
dim strTelecommuteSwitch
dim strTitle
dim strHireDate
dim strOnFloorDate
dim strHireStatus
dim strHireType
dim strNewHireManager
dim strLANHWLaptop
dim strLANHWDesktop
dim strLANHWSecureID
dim strLANACCTEmail
dim strLANACCTRightfax
dim strLANACCTPMF
dim strLANACCTRSVP
dim strLANACCTPEAK
dim strLANACCTNetware
dim strLANACCTNT
dim strLANACCTAccess
dim strLANSWPCPW
dim strLANSWHRizon
dim strTELECOMHWPhone
dim strTELECOMHWHeadset
dim strTELECOMHWCell
dim strTELECOMHWPager
dim strTELECOMHW800
dim strTELECOMSWAvaya
dim strMFACCTRACF
dim strMFACCTIDLX
dim strFACSVCSPasscard
dim strSpecialRequest

strNetID = Request.Form("NetID")
strFirstName = Request.Form("FirstName")
strLastName = Request.Form("LastName")
strDepartment = Request.Form("Department")
strOffice = Request.Form("Office")
strTelecommuteSwitch = Request.Form("TelecommuteSwitch")
strTitle = Request.Form("Title")
strHireDate = Request.Form("HireDate")
strOnFloorDate = Request.Form("OnFloorDate")
strHireStatus = Request.Form("HireStatus")
strHireType = Request.Form("HireType")
strNewHireManager = Request.Form("NewHireManager")
strLANHWLaptop = Request.Form("LANHWLaptop")
strLANHWDesktop = Request.Form("LANHWDesktop")
strLANHWSecureID = Request.Form("LANHWSecureID")
strLANACCTEmail = Request.Form("LANACCTEmail")
strLANACCTRightFax = Request.Form("LANACCTRightFax")
strLANACCTPMF = Request.Form("LANACCTPMF")
Response.Write strLANACCTPMF
strLANACCTRSVP = Request.Form("LANACCTRSVP")
strLANACCTPEAK = Request.Form("LANACCTPEAK")
strLANACCTNetware = Request.Form("LANACCTNetware")
strLANACCTNT = Request.Form("LANACCTNT")
strLANACCTAccess = Request.Form("LANACCTAccess")
strLANSWPCPW = Request.Form("LANSWPCPW")
strLANSWHRizon = Request.Form("LANSWHRizon")
strTELECOMHWPhone = Request.Form("TELECOMHWPhone")
strTELECOMHWHeadset = Request.Form("TELECOMHWHeadset")
strTELECOMHWCell = Request.Form("TELECOMHWCell")
strTELECOMHWPager = Request.Form("TELECOMHWPager")
strTELECOMHW800 = Request.Form("TELECOMHW800")
strTELECOMSWAvaya = Request.Form("TELECOMSWAvaya")
strMFACCTRACF = Request.Form("MFACCTRACF")
strMFACCTIDLX = Request.Form("MFACCTIDLX")
strFACSRVSPasscard = Request.Form("FACSRVSPasscard")
strSpecialRequest = Request.Form("SpecialRequest")

Set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
"c:/Database/LANAdmin/LANDATA.mdb" & ";"

set oRSLANDATA=Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM [Associate Setup] WHERE First_Name = '" &
strFirstName & "' AND Last_Name = '" & strLastName & "' ORDER BY
Last_Name;"
oRSLANDATA.Open strSQL, oConn, adOpenForwardOnly, adLockPessimistic,
adCmdText

If oRSLANDATA.EOF then
oRSLANDATA.AddNew
oRSLANDATA.Fields("ID")=strNetID
oRSLANDATA.Fields("Request_Date")=date()
oRSLANDATA.Fields("First_Name")=strFirstName
oRSLANDATA.Fields("Last_Name")=strLastName
oRSLANDATA.Fields("Title")=strTitle
oRSLANDATA.Fields("Department")=strDepartment
oRSLANDATA.Fields("Office")=strOffice
oRSLANDATA.Fields("Hire_Date")=strHireDate
oRSLANDATA.Fields("Out_of_Training")=strOnFloorDat e
oRSLANDATA.Fields("Add_Replace")=strHireStatus
oRSLANDATA.Fields("New_Hire_Transfer")=strHireType
oRSLANDATA.Fields("Reports_to")=strNewHireManager
oRSLANDATA.Fields("Telecommuter")=strTelecommuteSw itch
oRSLANDATA.Fields("Q_LAN_Laptop")=strLANHWLaptop
oRSLANDATA.Fields("Q_LAN_Desktop")=strLANHWDesktop
oRSLANDATA.Fields("Q_LAN_NetID")=strLANACCTNetware
oRSLANDATA.Fields("Q_LAN_NTID")=strLANACCTNT
oRSLANDATA.Fields("Q_LAN_Email")=strLANACCTEmail
oRSLANDATA.Fields("Q_LAN_RightFAX")=strLANACCTRigh tFax
oRSLANDATA.Fields("Q_LAN_PMF")=strLANACCTPMF
oRSLANDATA.Fields("Q_LAN_RSVP")=strLANACCTRSVP
oRSLANDATA.Fields("Q_LAN_PEAK")=strLANACCTPEAK
oRSLANDATA.Fields("Q_LAN_Access")=strLANACCTAccess
oRSLANDATA.Fields("Q_LAN_PCPW")=strLANSWPCPW
oRSLANDATA.Fields("Q_LAN_HRizon")=strLANSWHRizon
oRSLANDATA.Fields("Q_LAN_SecurID")=strLANHWSecureI D
oRSLANDATA.Fields("Q_TEL_Phone")=strTELECOMHWPhone
oRSLANDATA.Fields("Q_TEL_Headset")=strTELECOMHWHea dset
oRSLANDATA.Fields("Q_TEL_Cell_Phone")=strTELECOMHW Cell
oRSLANDATA.Fields("Q_TEL_Pager")=strTELECOMHWPager
oRSLANDATA.Fields("Q_TEL_800")=strTELECOMHW800
oRSLANDATA.Fields("Q_TEL_CenterVu")=strTELECOMSWAv aya
oRSLANDATA.Fields("Q_MAI_RACF")=strMFACCTRACF
oRSLANDATA.Fields("Q_MAI_IDLX")=strMFACCTIDLX
oRSLANDATA.Fields("Q_FAC_Passcard")=strFACSRVSPass card
oRSLANDATA.Fields("Q_Comments")=strSpecialRequest
oRSLANDATA.Update
Response.Write "Thank you for this information, <b>" & strNetID &
"</b>. You will be contacted soon with the New Hire Setup information."
Response.Write ""
Response.Write "<p>Please click <a
href=""../cisco_vpn_local2.asp"">here</a> for instructions on what will
follow.</p>"
Call EMAILBOT
Else
Response.Write "<BR></BR><p align=center><b>This LANID is already
registered. </b>Please select the BACK button above to select a new LAN
ID or contact LAN Support.</p>"
End If
%>
<%
Sub EMAILBOT
'create mail object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
'compose message
objCDOMail.From = "LAN Support <CL**************@adp.com>" 'this
format authors the e-mail as a name of your choice
objCDOMail.To = "CL************@adp.com;"
'objCDOMail.To = "" & strFirstName & "_" & strLastName & "@adp.com"
objCDOMail.Cc = ""
objCDOMail.Importance = 2 '(0=Low, 1=Normal, 2=High)
objCDOMail.Subject = "New Hire Registration Confirmation"
objCDOMail.Body = "" & strFirstName & "," & vbCrLf &_
vbCrLf & vbCrLf & _
"Thank you for registering this new hire. This
message will serve as a confirmation of your " & vbCrLf &_
"new hire registration using the name of " &
strFirstName & ", " & strLastName & ". All parties" & vbCrLf &_
"will contact you to provide the account information
requested. " & vbCrLf &_
"" & vbCrLf & vbCrLf & vbCrLf & "" &_
"Regards," & vbCrLf &_
"LAN Support"
objCDOMail.MailFormat = 0 ' CdoMailFormatMime 'use for MS Outlook mail
'send message
objCDOMail.Send
'cleanup
Set objCDOMail = Nothing
End Sub
%>
<%
oRSLANDATA.Close
Set oRSLANDATA = Nothing
oConn.Close
Set oConn = Nothing
%>
</body>
</html>

Apr 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Bill wrote:
I'm using the POST method to submit a simple form html page with yes/no

and checkbox fields to an asp response page which stores the values in
a new dim string, then uses it to build a new table using ADO. I'm
getting sometimes correct values, sometimes null values (when I know I
pass a valid default value) and other times multiple values! I know
what the values coming over are because I do a response.write to see it

before the error appears. The errors that I get are multistep value
errors or more commonly data type value errors. For example, a field is

set with a 0 for No, or a 1 for Yes is supposed to send a "0" by
default. In some fields it does, in others it sends a null value, still

others it sends a "0,1". Both values!


And this always happens with LANACCTPMF and TELECOMHWHeadset, right?
That's because you have two fields with the same names.

Incidentally, you should not be creating a recordset to effect an
Insert.

http://www.aspfaq.com/show.asp?id=2191

Nor should you be using the deprecated ODBC driver:

http://www.aspfaq.com/show.asp?id=2126

--
Mike Brind

Apr 17 '06 #2

P: n/a

Bill wrote:
<snip>
Sub EMAILBOT
'create mail object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

Oh, and CDONTS has been deprecated in favour of CDO.

http://www.aspfaq.com/show.asp?id=2339

--
Mike Brind

Apr 17 '06 #3

P: n/a
Yes, that was it. I did not view the actual HTML code well enough.

Apr 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.