Tom,
If I accept the default "Option 1", "Option 2", etc. then I never run into a
problem. The mis-representation begins once the "Value" has been updated. No
changes are being made to the database and the new value is just text.
The pages were generated from FrontPage 2003 and I selected VBScript for the
coding language. Looking at the code below, it appears that FrontPage didn't
re-code all of the pages from JavaScript to VBScript.
Here is the code for the Submission (VBScript), Detail(JavaScript) and
Edit(JavaScript and VBScript) ASP pages:
Thanks for your assistance.
David
*****************Submission page:
<%
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
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("coursesubmitterdb_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(27)
Dim arFormDBFields0(27)
Dim arFormValues0(27)
arFormFields0(14) = "CourseLab"
arFormDBFields0(14) = "CourseLab"
arFormValues0(14) = Request("CourseLab")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"submission_form.asp",_
"Return to the form."
End If
End If
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
%>
<% Response.Buffer = True %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- New</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" align=left>
<tr>
<td width="50%">
<b><font size=+3 color="#000080"> Course Submission Form </font></b>
</td>
<td width="50%" align=right>
<table>
<tr>
<td>
<a href="../results_page.asp" target="_top">Results Page</a> |
Submission Form
| <a href="database_editor.asp" target="_top">Database Editor</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>
<br clear="all">
<hr>
<p>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan -->
<script Language="VBScript" Type="text/vbscript">
<!--
function FrontPage_Form1_onsubmit()
Set theForm = document.FrontPage_Form1
radioSelected = False
For i = 0 to theForm.CourseLab.length - 1
If (theForm.CourseLab.item(i).checked) Then
radioSelected = True
End If
Next
If (Not radioSelected) Then
MsgBox "Please select one of the ""CourseLab"" options.", 0, "Validation
Error"
FrontPage_Form1_onsubmit = False
Exit Function
End If
--></script>
<!--webbot BOT="GeneratedScript" endspan --><form METHOD="POST"
action="submission_form.asp" name="FrontPage_Form1"
webbot-action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp"
S-DataConnection="coursesubmitterdb" S-RecordSource="Results"
S-Form-Fields="CourseLab" S-Form-DBFields="CourseLab"
U-ASP-Include-Url="../../../_fpclass/fpdbform.inc" startspan
U-Database-URL="../../../fpdb/coursesubmitterdb.mdb"
S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp REMOTE_USER"
S-Builtin-DBFields="Remote_computer_name Browser_type Timestamp
User_name" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase"
endspan i-checksum="52631" -->
<p><b>Course lab: </b>
<!--webbot bot="Validation" s-display-name="Key,CourseLab"
b-value-required="TRUE" -->
<input type="radio" name="CourseLab" value="Yes" tabindex="7" >Yes
<input type="radio" name="CourseLab" value="No" tabindex="8" >No<br>
</p>
<p><input type="submit" value=" OK " tabindex="38"><input type="reset"
value=" Reset " tabindex="39"></p>
</form>
</body>
</html>
********************Detail List page:
<html>
<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not
Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- Home</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body bgcolor="#FFFFFF">
<!--webbot bot="PurpleText" PREVIEW="-Important- If you modify this
Database Results region using the Database Results Wizard, then your
Database Editor will no longer work. If you accidentally open the Database
Results Wizard, simply click Cancel to exit without regenerating the
Database Results region." -->
<!--webbot bot="DatabaseRegionStart"
s-columnnames="Key,CourseLab"s-columntypes="3,202"
s-dataconnection="coursesubmitterdb" b-tableformat="FALSE"
b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="FALSE" i-ListFormat="5" b-makeform="FALSE"
s-RecordSource="Results" s-displaycolumns="Key,CourseLab"s-criteria="{Key}
EQ {Key} +" s-order s-sql="SELECT * FROM Results WHERE Key = ::Key::"
b-procedure="FALSE" clientside SuggestedExt="asp" s-DefaultFields="Key=0"
s-NoRecordsFound="No records returned." i-MaxRecords="1" i-GroupSize="0"
u-dblib="../../../_fpclass/fpdblib.inc"
u-dbrgn1="../../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../../_fpclass/fpdbrgn2.inc" Tag="BODY" startspan BOTID="0"
preview="<table border=0 width="100%"><tr><td
bgcolor="#FFFF00"><font color="#000000">This is
the start of a Database Results region. The page must be fetched from a web
server with a web browser to display correctly; the current web is stored on
your local disk or
network.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results WHERE Key = ::Key::"
fp_sDefault="Key=0"
fp_sNoRecords="No records returned."
fp_sDataConn="coursesubmitterdb"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&Key=3&CourseLab=&"
fp_iDisplayCols=28
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan -->
<table BORDER=1 style="border-collapse: collapse" cellpadding="3">
<tr>
<td><b>Key:</b></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="Key,CourseLab"
s-column="Key" b-tableformat="TRUE" b-hasHTML="FALSE" clientside startspan
b-makelink b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>Key<font
size="-1">&gt;&gt;</font>" -->
<%=FP_FieldVal(fp_rs,"Key")%><!--webbot bot="DatabaseResultColumn"
endspan --></td>
</tr>
<tr>
<td><b>Course Lab:</b></td>
<td>
<!--webbot bot="DatabaseResultColumn"
s-columnnames="Key,CourseLab"s-column="CourseLab" b-tableformat="TRUE"
b-hasHTML="FALSE" clientside startspan b-makelink b-MenuFormat
preview="<font
size="-1">&lt;&lt;</font>CourseLab<font
size="-1">&gt;&gt;</font>"
s-ColumnTypes="3,202" -->
<%=FP_FieldVal(fp_rs,"CourseLab")%><!--webbot bot="DatabaseResultColumn"
endspan --></td>
</tr>
<form method="POST" action="edit.asp">
<input type="hidden" name="Key" value="<%=FP_FieldHTML(fp_rs,"Key")%>">
<p><input type="submit" value=" Edit " name="B1"></p>
</form>
</td>
<td>
<form method="POST" action="delete.asp">
<input type="hidden" name="Key" value="<%=FP_FieldHTML(fp_rs,"Key")%>">
<p><input type="submit" value="Delete" name="B1"></p>
</form>
</td>
</tr>
</table></td></tr>
</table>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="../../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside Tag="BODY" startspan preview="<table border=0
width="100%"><tr><td
bgcolor="#FFFF00"><font color="#000000">This is
the end of a Database Results
region.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan -->
</body>
</html>
**********************Edit page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- Edit</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body bgcolor="#FFFFFF">
<!--webbot bot="PurpleText" PREVIEW="-Important- If you modify this
Database Results region using the Database Results Wizard, then your
Database Editor will no longer work. If you accidentally open the Database
Results Wizard, simply click Cancel to exit without regenerating the
Database Results region." -->
<!--webbot bot="DatabaseRegionStart"
s-columnnames="Key,CourseLab"s-columntypes="3,202"
s-dataconnection="coursesubmitterdb" b-tableformat="FALSE"
b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="FALSE" i-ListFormat="5" b-makeform="FALSE"
s-RecordSource="Results" s-displaycolumns="Key,CourseLab"s-criteria="{Key}
EQ {Key} +" s-order s-sql="SELECT * FROM Results WHERE Key = ::Key::"
b-procedure="FALSE" clientside SuggestedExt="asp" s-DefaultFields="Key=0"
s-NoRecordsFound="No records returned." i-MaxRecords="1" i-GroupSize="0"
u-dblib="../../../_fpclass/fpdblib.inc"
u-dbrgn1="../../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../../_fpclass/fpdbrgn2.inc" Tag="BODY" startspan BOTID="0"
preview="<table border=0 width="100%"><tr><td
bgcolor="#FFFF00"><font color="#000000">This is
the start of a Database Results region. The page must be fetched from a web
server with a web browser to display correctly; the current web is stored on
your local disk or
network.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results WHERE Key = ::Key::"
fp_sDefault="Key=0"
fp_sNoRecords="No records returned."
fp_sDataConn="coursesubmitterdb"
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&Key=3&CourseLab=&"
fp_iDisplayCols=28
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan -->
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan -->
<script Language="VBScript" Type="text/vbscript">
<!--function FrontPage_Form1_onsubmit()
Set theForm = document.FrontPage_Form1
radioSelected = False
For i = 0 to theForm.CourseLab.length - 1
If (theForm.CourseLab.item(i).checked) Then
radioSelected = True
End If
Next
If (Not radioSelected) Then
MsgBox "Please select one of the ""CourseLab"" options.", 0, "Validation
Error"
FrontPage_Form1_onsubmit = False
Exit Function
End If
FrontPage_Form1_onsubmit = True
End Function
-->
</script>
<!--webbot BOT="GeneratedScript" endspan -->
<form METHOD="POST" action="update.asp" name="FrontPage_Form1">
<table BORDER=1 style="border-collapse: collapse" cellpadding="3">
<tr>
<td><b>Course Lab:</b></td>
<td><p>
<!--webbot bot="Validation" s-display-name="CourseLab"
b-value-required="TRUE" -->
<input type="radio" name="CourseLab" <% if "Yes" =
FP_Field(fp_rs,"CourseLab") then %> <% end if %> value="Yes" checked>Yes<br>
<input type="radio" name="CourseLab" <% if "No" =
FP_Field(fp_rs,"CourseLab") then %> <% end if %> value="No" checked >No</p>
</td>
</tr>
</table>
<input type="hidden" name="Key" value="<%=FP_FieldHTML(fp_rs,"Key")%>">
</form>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="../../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside Tag="BODY" startspan preview="<table border=0
width="100%"><tr><td
bgcolor="#FFFF00"><font color="#000000">This is
the end of a Database Results
region.</font></td></tr></table>" --><!--#include
file="../../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan -->
</body>
</html>