Move the code I gave you above
<%
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.
That is the top of the page (isn't it)
And how do you expect the form to send a dropdown form field value if you don't set a value for it?
You have
<select size="1" name="DriveReplaced" style="font-size: 16pt" tabindex="3">
<option selected>No</option>
<option>Yes</option>
</select>
All that sends is a selected index # (0 or 1) and not a Yes or No
You should have (w/o your massive font):
<select size="1" name="DriveReplaced" tabindex="3">
<option selected value="No">No</option>
<option value="Yes">Yes</option>
</select>
PS
Same applies to all your other dropdowns which have no values assigned in Form Field Properties
IMHO
Stop work and start reading all the books you have
| Here's the code for the whole page.
|
| <%
| ' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.
|
| On Error Resume Next
| Session("FP_OldCodePage") = Session.CodePage
| Session("FP_OldLCID") = Session.LCID
| Session.CodePage = 1252
| Session.LCID = 2057
| Err.Clear
|
| strErrorUrl = ""
|
| If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
| If Request.Form("VTI-GROUP") = "0" Then
| Err.Clear
|
| Set fp_conn = Server.CreateObject("ADODB.Connection")
| FP_DumpError strErrorUrl, "Cannot create connection"
|
| Set fp_rs = Server.CreateObject("ADODB.Recordset")
| FP_DumpError strErrorUrl, "Cannot create record set"
|
| fp_conn.Open Application("Database_ConnectionString")
| FP_DumpError strErrorUrl, "Cannot open database"
|
| fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic,
| adCmdTable
| FP_DumpError strErrorUrl, "Cannot open record set"
|
| fp_rs.AddNew
| FP_DumpError strErrorUrl, "Cannot add new record set to the database"
| Dim arFormFields0(6)
| Dim arFormDBFields0(6)
| Dim arFormValues0(6)
|
| arFormFields0(0) = "DriveNo"
| arFormDBFields0(0) = "DriveNo"
| arFormValues0(0) = Request("DriveNo")
| arFormFields0(1) = "DriveReplaced"
| arFormDBFields0(1) = "DriveReplaced"
| arFormValues0(1) = Request("DriveReplaced")
| arFormFields0(2) = "TrayFault"
| arFormDBFields0(2) = "TrayFault"
| arFormValues0(2) = Request("TrayFault")
| arFormFields0(3) = "UnlistedFault"
| arFormDBFields0(3) = "UnlistedFault"
| arFormValues0(3) = Request("UnlistedFault")
| arFormFields0(4) = "TrayReplaced"
| arFormDBFields0(4) = "TrayReplaced"
| arFormValues0(4) = Request("TrayReplaced")
| arFormFields0(5) = "DriveFault"
| arFormDBFields0(5) = "DriveFault"
| arFormValues0(5) = Request("DriveFault")
|
| FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
|
| If Request.ServerVariables("REMOTE_HOST") <> "" Then
| FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"),
| "Remote_computer_name"
| End If
| If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
| FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"),
| "Browser_type"
| End If
| FP_SaveFieldToDB fp_rs, Now, "Timestamp"
| If Request.ServerVariables("REMOTE_USER") <> "" Then
| FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name"
| End If
|
| fp_rs.Update
| FP_DumpError strErrorUrl, "Cannot update the database"
|
| fp_rs.Close
| fp_conn.Close
|
| Session("FP_SavedFields")=arFormFields0
| Session("FP_SavedValues")=arFormValues0
| Session.CodePage = Session("FP_OldCodePage")
| Session.LCID = Session("FP_OldLCID")
| Response.Redirect "Database.asp"
|
| End If
| End If
|
| Session.CodePage = Session("FP_OldCodePage")
| Session.LCID = Session("FP_OldLCID")
|
| %>
| <%
| For Each Item In Request.Form
| fieldName = Item
| fieldValue = Request(Item)
| Response.Write fieldName & " = " & fieldValue & "<br>"
| Next
| %>
|
| <%
| Response.write "Drive Replaced value = " & Request.Form("DriveReplaced")
| If Request.Form("DriveReplaced") = "Yes" Then Response.Redirect "BL35P.asp"
| %>
|
| <html>
|
| <head>
| <meta http-equiv="Content-Language" content="en-gb">
| <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| <title>New Page 1</title>
| </head>
|
| <body>
| <h1 align="center">Database<br>
| </h1>
| <form method="POST" action="--WEBBOT-SELF--" name="Database.asp">
| <!--webbot bot="SaveDatabase" SuggestedExt="asp"
| S-DataConnection="Database" S-RecordSource="Results"
| U-Database-URL="../fpdb/Database.mdb" S-Builtin-Fields="REMOTE_HOST
| HTTP_USER_AGENT Timestamp REMOTE_USER"
| S-Builtin-DBFields="Remote_computer_name Browser_type Timestamp User_name"
| S-Form-Fields="DriveNo DriveReplaced TrayFault UnlistedFault TrayReplaced
| DriveFault" S-Form-DBFields="DriveNo DriveReplaced TrayFault UnlistedFault
| TrayReplaced DriveFault" U-ASP-Include-Url="../_fpclass/fpdbform.inc"
| startspan U-Confirmation-Url="Database.asp" --><input TYPE="hidden"
| NAME="VTI-GROUP" VALUE="0"><!--#include
| file="../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan
| i-checksum="34604" -->
| <p><font style="font-size: 16pt; font-weight: 700">Drive Number</font><br>
| <font style="font-size: 16pt; font-weight: 700">
| <input type="text" name="DriveNo" size="20" style="font-size: 16pt"
| tabindex="1"></font></p>
| <p><font style="font-size: 16pt; font-weight: 700">Drive
| Fault
| Drive Replaced</font><br>
| <font style="font-size: 16pt; font-weight: 700">
| <select size="1" name="DriveFault" style="font-size: 16pt" tabindex="2">
| <option selected>No Fault Found</option>
| <option>Imminent Failure</option>
| <option>Failed To ID</option>
| <option>Damaged Connector</option>
| <option>Had Partition</option>
| </select>
| <select size="1" name="DriveReplaced" style="font-size: 16pt" tabindex="3">
| <option selected>No</option>
| <option>Yes</option>
| </select> </font></p>
| <p><font style="font-size: 16pt; font-weight: 700">Tray
| Fault Tray
| Replaced</font><br>
| <font style="font-size: 16pt; font-weight: 700">
| <select size="1" name="TrayFault" style="font-size: 16pt" tabindex="4">
| <option selected>No Fault Found</option>
| <option>Damaged Tray</option>
| <option>Missing Handle</option>
| <option>Broken Handle</option>
| <option>Missing Antiship Rod</option>
| </select>
| <select size="1" name="TrayReplaced" style="font-size: 16pt" tabindex="5">
| <option selected>No</option>
| <option>Yes</option>
| </select></font></p>
| <p><font style="font-size: 16pt; font-weight: 700">Unlisted Fault</font><br>
| <font style="font-size: 16pt; font-weight: 700">
| <textarea rows="4" name="UnlistedFault" cols="51" style="font-size: 16pt;
| font-weight:bold" tabindex="6"></textarea></font></p>
| <p align="center"><input type="submit" value="Submit" name="B1"
| style="font-size: 16pt">
| <input type="reset" value="Reset" name="B2" style="font-size: 16pt"></p>
| </form>
|
|
|
| </body>
|
|
|
| </html>
|
|
|
| The file name is Database.asp
|
| "Stefan B Rusynko" wrote:
|
| > Just post a copy (code snippet) of your page code for the Form and the filename of the page running it
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | If you mean you want me to post on here where the location of the website is
| > | i'm afraid it would be pointless as it's on a private network in or work, at
| > | present i'm testing things out on my PC using the hosting feature that you
| > | get on XP professional therfore the best i could do would be to post or email
| > | the page to you.
| > |
| > | I don't make things easy do i?
| > |
| > | Sorry...
| > |
| > |
| > | Al....
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > Post the location of the form page on the web
| > | > - the online site URL of where you have your form page that you are testing
| > | > (if it is published to a hosted online server someplace)
| > | >
| > | > --
| > | >
| > | > _____________________________________________
| > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > To find the best Newsgroup for FrontPage support see:
| > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > _____________________________________________
| > | >
| > | >
| > | > | I'm not sure what you mean by "Post a URL to your form test page online"
| > | > |
| > | > | Do you mean create a confirmation page that shows all the posted results?
| > | > | would that not be the same as the default one that FP does?
| > | > |
| > | > |
| > | > | "Stefan B Rusynko" wrote:
| > | > |
| > | > | > Post a URL to your form test page online
| > | > | >
| > | > | > The For Each Next code will only work on the page the form is submitted to for processing (action)
| > | > | >
| > | > | > --
| > | > | >
| > | > | > _____________________________________________
| > | > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > | > To find the best Newsgroup for FrontPage support see:
| > | > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > | > _____________________________________________
| > | > | >
| > | > | >
| > | > | > |I added
| > | > | > |
| > | > | > | <%
| > | > | > | For Each Item In Request.Form
| > | > | > | fieldName = Item
| > | > | > | fieldValue = Request.Form(Item)
| > | > | > | Response.Write fieldName & " = " & fieldValue & "<br>"
| > | > | > | Next
| > | > | > | %>
| > | > | > |
| > | > | > | and still no response.
| > | > | > |
| > | > | > | The field values are being passed as they are being inserted into the
| > | > | > | database, also if i dont specify a conformation page, then FP default
| > | > | > | conformation shows the field names and values inserted.
| > | > | > |
| > | > | > | In the code written by FP it shows
| > | > | > | arFormValues0(1) = Request("DriveReplaced")
| > | > | > |
| > | > | > | the default value for this field is no
| > | > | > |
| > | > | > | and the code you asked me to enter does write on the page and it is shown as
| > | > | > | Drive Replaced value=
| > | > | > | as you stated.
| > | > | > |
| > | > | > | I'm sure it's something stupid (ME)
| > | > | > |
| > | > | > |
| > | > | > | Al....
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | > | "Stefan B Rusynko" wrote:
| > | > | > |
| > | > | > | > Then the form field is either
| > | > | > | > - not named "DriveReplaced"
| > | > | > | > - not sending or not set to send a value of "Yes" (w/o the quotes) from the dropdown option
| > | > | > | >
| > | > | > | > Change
| > | > | > | > Response.write Request.Form("DriveReplaced")
| > | > | > | > to
| > | > | > | > Response.write "Drive Replaced value= " & Request.Form("DriveReplaced")
| > | > | > | >
| > | > | > | > If you just see the below at the top of your page after sending the form it is a field value/name problem
| > | > | > | > Drive Replaced value=
| > | > | > | >
| > | > | > | > Post a URL to your form test page online
| > | > | > | >
| > | > | > | > PS
| > | > | > | > To see all your real form field names and values being passed (after the form is submitted) paste the below at the
very
| > top
| > | > of
| > | > | > the
| > | > | > | > page
| > | > | > | >
| > | > | > | > <%
| > | > | > | > For Each Item In Request.Form
| > | > | > | > fieldName = Item
| > | > | > | > fieldValue = Request.Form(Item)
| > | > | > | > Response.Write fieldName & " = " & fieldValue & "<br>"
| > | > | > | > Next
| > | > | > | > %>
| > | > | > | >
| > | > | > | > --
| > | > | > | >
| > | > | > | > _____________________________________________
| > | > | > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > | > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > | > | > To find the best Newsgroup for FrontPage support see:
| > | > | > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > | > | > _____________________________________________
| > | > | > | >
| > | > | > | >
| > | > | > | > | It doesn't show the value at the top of the page or anywhere else, it tried
| > | > | > | > | it 4 or 5 times just to be sure.
| > | > | > | > |
| > | > | > | > | I have also Changed "yourformfieldnamehere" to "DriveReplaced" and
| > | > | > | > | "yourpage2.asp" to "BL35P.asp"
| > | > | > | > |
| > | > | > | > | <%
| > | > | > | > | Response.write Request.Form("DriveReplaced")
| > | > | > | > | If Request.Form("DriveReplaced")="Yes" Then response.redirect "BL35P.asp"
| > | > | > | > | %>
| > | > | > | > |
| > | > | > | > | There must be something else in the coding that's stoping it working.
| > | > | > | > | BL35P.asp is in the same folder, it's not the page i will be directing to, i
| > | > | > | > | just used it to test it.
| > | > | > | > |
| > | > | > | > | Would you like me to post the FP coding, or the whole page code.?
| > | > | > | > |
| > | > | > | > | Al....
| > | > | > | > |
| > | > | > | > |
| > | > | > | > | "Stefan B Rusynko" wrote:
| > | > | > | > |
| > | > | > | > | > To see the value of the form field "yourformfieldnamehere" at the top of your page change it to:
| > | > | > | > | > <%
| > | > | > | > | > ' delete below line after testing is done
| > | > | > | > | > Response.write Request.Form("yourformfieldnamehere")
| > | > | > | > | > ' make sure you change "yourformfieldnamehere" to your actual form field name
| > | > | > | > | > If Request.Form("yourformfieldnamehere")="Yes" Then response.redirect "yourpage2.asp"
| > | > | > | > | > 'goes to page 2.asp only if the form has sent a field value of "Yes"
| > | > | > | > | > %>
| > | > | > | > | >
| > | > | > | > | > You won't see anything until you submit the form (to itself - the page w/ this code in it) and select the Yes
drop
| > down
| > | > | > (which
| > | > | > | > also
| > | > | > | > | > has to have a value of "Yes" in it)
| > | > | > | > | >
| > | > | > | > | > PS
| > | > | > | > | > - this has nothing to do w/ ASP.net
| > | > | > | > | > --
| > | > | > | > | >
| > | > | > | > | > _____________________________________________
| > | > | > | > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > | > | > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > | > | > | > To find the best Newsgroup for FrontPage support see:
| > | > | > | > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > | > | > | > _____________________________________________
| > | > | > | > | >
| > | > | > | > | >
| > | > | > | > | > | > | thanks but it didn't do the trick.
| > | > | > | > | > | I tried adding it right at the very top of the page above the ASP code
| > | > | > | > | > | already in the page and tried it below the asp code already in the page.
| > | > | > | > | > |
| > | > | > | > | > | I should mention that the web Bot conformation page is set to redirect to
| > | > | > | > | > | the same page, should i maybe take that out and add an else or something into
| > | > | > | > | > | the code that you gave me.?
| > | > | > | > | > |
| > | > | > | > | > | Looks like this is another book for me to buy. would it be a book on ASP.net
| > | > | > | > | > | as i have seen these in the college book shop, or would it need to be a book
| > | > | > | > | > | specifically on coding ASP pages.
| > | > | > | > | > | Since we last chatted i have bought books on Access, SQL, Frontpage,
| > | > | > | > | > | VBScript, and javascript, a bit heavy going but i'm learning.
| > | > | > | > | > |
| > | > | > | > | > |
| > | > | > | > | > |
| > | > | > | > | > | "Stefan B Rusynko" wrote:
| > | > | > | > | > |
| > | > | > | > | > | > If you don't know if it is VBscript (ASP) you probably shouldn't attempt below
| > | > | > | > | > | > - the pages should have a .asp extension if you are running ASP
| > | > | > | > | > | >
| > | > | > | > | > | > At the top of your .asp page add
| > | > | > | > | > | > <%
| > | > | > | > | > | > Request.Form("yourformfieldnamehere")
| > | > | > | > | > | > If Request.Form("yourformfieldnamehere")="Yes" Then response.redirect "yourpage2.asp"
| > | > | > | > | > | > 'goes to page 2.asp only if the form has sent a field value of "Yes"
| > | > | > | > | > | > %>
| > | > | > | > | > | >
| > | > | > | > | > | > --
| > | > | > | > | > | >
| > | > | > | > | > | > _____________________________________________
| > | > | > | > | > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > | > | > | > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > | > | > | > | > To find the best Newsgroup for FrontPage support see:
| > | > | > | > | > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > | > | > | > | > _____________________________________________
| > | > | > | > | > | >
| > | > | > | > | > | >
| > | > | > | > | > | > | > | > | Everything was set up through FP 2003, sending to Access DB, so i'd assume
| > | > | > | > | > | > | it's using VBScript.
| > | > | > | > | > | > |
| > | > | > | > | > | > | "Stefan B Rusynko" wrote:
| > | > | > | > | > | > |
| > | > | > | > | > | > | > Yes
| > | > | > | > | > | > | > - but not w/ the FP Default forms handler
| > | > | > | > | > | > | > If you are using a server side script language to send the form to the DB
| > | > | > | > | > | > | > - then it depends on the language you are using
| > | > | > | > | > | > | > --
| > | > | > | > | > | > | >
| > | > | > | > | > | > | > _____________________________________________
| > | > | > | > | > | > | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > | > | > | > | > | > "Warning - Using the F1 Key will not break anything!" (-;
| > | > | > | > | > | > | > To find the best Newsgroup for FrontPage support see:
| > | > | > | > | > | > | >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | > | > | > | > | > | > _____________________________________________
| > | > | > | > | > | > | >
| > | > | > | > | > | > | >
| > | > | > | > | > | > | > | > | > | > | currently i have a form that submits information entered by the user (we'll
| > | > | > | > | > | > | > | call it page1) once the information is entered it is sent to a database and
| > | > | > | > | > | > | > | the page redirects to its-self. that's all fine.
| > | > | > | > | > | > | > | What i want to know is if a certain field (dropdown box) is YES, can i still
| > | > | > | > | > | > | > | submit the information but redirect to another page, say page 2, fill the
| > | > | > | > | > | > | > | information in, then when submited redirect back to page 1
| > | > | > | > | > | > | > |
| > | > | > | > | > | > | > | i hope i've not confused anyone with the above, as i've usually got a habit
| > | > | > | > | > | > | > | of not explaining myself correctly.
| > | > | > | > | > | > | > |
| > | > | > | > | > | > | > | Any help would be appreciated.
| > | > | > | > | > | > | > |
| > | > | > | > | > | > | >
| > | > | > | > | > | > | >
| > | > | > | > | > | > | >
| > | > | > | > | > | >
| > | > | > | > | > | >
| > | > | > | > | > | >
| > | > | > | > | >
| > | > | > | > | >
| > | > | > | > | >
| > | > | > | >
| > | > | > | >
| > | > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >