Post and redirect

S

Stefan B Rusynko

Save a dollar and a tree
- start at http://www.w3schools.com/

--




|I pretty much understand what your stating, the reason i didn't use radio
| buttons is that this page that i am using is not the current one, (the site
| is one i use for testing any new code before adding it to the LIVE in use
| site) as the actual dropdown box has an option with "Awaiting Spares", As for
| the access database i never set that field up to only accept Yes or No as i
| thought at somepoint i would be changing/altering it, as i have done.
| Yes i did try the code on the Live site and no it still didn't work.
|
| The other dropdown boxes (not yes or no) never had a value specified and
| they also passed the information correctly, hence me thinking that if a value
| is not specified, FP coding will set it up to send the Option name as the
| value.
|
| Yes i do agree that i have very little knowledge of asp programming, i will
| buy a book or books when i find a suitable one, and when i have the cash flow.
|
| thanks for your help anyway.
|
|
| Al....
|
| "Stefan B Rusynko" wrote:
|
| > You don't upset me, but you need to start doing some studying of html & asp if you are going to attempt anything beyond the
wizards
| >
| > If your Access DB is set w/ a Yes/No (or true/false) field it will display as Yes for a value of 1 and No for a value of 0
| > (which just happens to be the select index values for your select field - so that is why it appears to work in Access)
| >
| > If you want to preserve that, change your select to
| > <select size="1" name="DriveReplaced" tabindex="3">
| > <option selected value="0">No</option>
| > <option value="1">Yes</option>
| > </select>
| >
| > But normally for a yes/no field you should be using radio buttons form fields as
| >
| > <p>Drive Replaced?:
| > <input type="radio" value="0" checked name="DriveReplaced">No
| > <input type="radio" value="1" name="DriveReplaced">Yes</p>
| >
| > And check for it using in the form page (which I was presuming was Database.asp)
| > <%
| > If CInt(Request.Form("DriveReplaced"))=1 Then Response.Redirect "yourpage2.asp"
| > 'goes to page 2.asp only if the form has sent a field value of "Yes"
| > %>
| >
| > But if you are using the FP DB wizards w/ a confirmation page that code belongs in Database.asp
| > - not in your form page
| > If it will work at all, since the FP SE / DBRW handle that page and by the time it is rendered the Data may have been sent to
the
| > DB, processed by some other FP inc. page and the just displaying the Database.asp as a response redirect - so all form field
data is
| > lost by that point)
| >
| > If it does not work there, you will need to learn to hand code ASP and query your DB on the confirmation page Database.asp for
the
| > value just written to DriveReplaced in the DB
| >
| > --
| >
| > _____________________________________________
| > 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
| > _____________________________________________
| >
| >
| > | Firstly i'm sorry if i've upset you, with what at first glance looks like my
| > | stupidty, but was really my not explaining what i have and haven't tried.
| > |
| > | The code was at the top of the page and as it didn't work i moved it, but
| > | kept it above the head tag.
| > |
| > | Secondly, as previously stated the values are passed as Yes, No and what
| > | ever else i add, as they are entered into the database, i'm assuming that FP
| > | adds extra code that says if you dont specify a Value then the dropdown
| > | option is also the value.
| > |
| > | Thirdly i tried what you suggested and there was no difference. As for
| > | reading books I have looked at the books i have but there is no mention of
| > | redirecting, which is why i asked you about ASP books earlier.
| > |
| > | So looks like i'm still at square 1.
| > |
| > | Here is something which may shed some light on the subject, in the WEBBOT
| > | code there is
| > | U-Confirmation-Url="Database.asp"
| > | If i delete this then the default FP confirmation page comes up, if i chane
| > | it then i redirect to the specified page.
| > | Could this be overriding the redirect in the asp code, which is during this
| > | experiment i never chnged from
| > | Response.Redirect "Database.asp"
| > | which sits at the bottom of the original code in the page.
| > |
| > | I'll try to explain what i've done each time so that i don't upset you. Sorry.
| > |
| > |
| > | Al....
| > |
| > |
| > |
| > | "Stefan B Rusynko" wrote:
| > |
| > | > 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
| > | >
| > | > _____________________________________________
| > | > 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
| > | > _____________________________________________
| > | >
| > | >
| > | > | 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">
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top