Hi:
Thanks for your advise.
I tried to use filed to validate but dropped it after I failed for many
times and could not find any information from MS.
The webbot, however, does process the form submission and database part
though.
The following is my codes, and I will post it in two parts: (1) The ASP page
of the form , and (2) Java scripts that I intended to insert into the ASP
page.
One more question - I also tried ASP.Net control from samples of MS and
seems it cannot coexist with ASP. In addition, I read somewhere during
research on the net, JavaScript also cannot coexist with ASP. And there are
other ActiveX, Vbasic and so on. In order to find the right codes to use,
what languages CAN coexist with ASP? My server does support ASP.NET, and if
I wish to use ASP.NET codes, does it mean that I have to re-generate the
whole page and remove ALL those generated by FP 2003?
------- Here are java codes - I tried them on a separate page and they
worked --------------------
<html>
<head>
<title>Login Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
<!--
function checkEntries(frm)
{
// Ensure something has been entered for a username
if (frm.un.value == "")
{
alert('You must provide a username to login');
frm.un.focus();
return false;
}
// Ensure something has been entered for a password
else if (frm.pw.value == "")
{
alert('You must provide a password to login');
frm.pw.focus();
return false;
}
// Ensure the password is at least six characters
else if (frm.pw.value.length < 6)
{
alert('The password must be at least six characters');
frm.pw.focus();
frm.pw.select();
return false;
}
// If the confirmation passowrd doesn't match the original password,
// show an error message, set focus back to the field, and
highlight the entry.
else if (frm.confpw.value != frm.pw.value)
{
alert('The confirmation password does not match the original
password');
frm.confpw.focus();
frm.confpw.select();
return false;
}
return true;
}
//-->
</script>
</head>
<body>
<h1>Login Details</h1
-----------------------------------------
Note: The part I wish to use is checking confirmation password against the
password starting from "else if (frm.confpw.value != frm.pw.value)...". I
changed "else if" to"if" as this is the only part to be use.. "frm" = form
name, "confpw" = field name.
----------------------------------------------------------------------------
------------------------------------------
The following is ASP codes - I took some option items and HTML text off to
save some space. Kindly tell me where should I put the above code in order
to work, if possibe at all.
----------------------------------------------------------------------------
-----------------------------------------------
<%
' 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 = 1033
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("Logon_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "tb1Users", 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(14)
Dim arFormDBFields0(14)
Dim arFormValues0(14)
arFormFields0(0) = "ConfirmPassword"
arFormDBFields0(0) = "ConfirmPWD"
arFormValues0(0) = Request("ConfirmPassword")
arFormFields0(1) = "Terms"
arFormDBFields0(1) = "AgreePolicy"
arFormValues0(1) = Request("Terms")
arFormFields0(2) = "Info_Shalom"
arFormDBFields0(2) = "Info_Shalom"
arFormValues0(2) = Request("Info_Shalom")
arFormFields0(3) = "Password"
arFormDBFields0(3) = "PWD"
arFormValues0(3) = Request("Password")
arFormFields0(4) = "JobTitle"
arFormDBFields0(4) = "JobTitle"
arFormValues0(4) = Request("JobTitle")
arFormFields0(5) = "industry"
arFormDBFields0(5) = "Industry"
arFormValues0(5) = Request("industry")
arFormFields0(6) = "UserName"
arFormDBFields0(6) = "UID"
arFormValues0(6) = Request("UserName")
arFormFields0(7) = "Email"
arFormDBFields0(7) = "Email"
arFormValues0(7) = Request("Email")
arFormFields0(8) = "FirstName"
arFormDBFields0(8) = "FirstName"
arFormValues0(8) = Request("FirstName")
arFormFields0(9) = "department"
arFormDBFields0(9) = "Department"
arFormValues0(9) = Request("department")
arFormFields0(10) = "Country"
arFormDBFields0(10) = "Country"
arFormValues0(10) = Request("Country")
arFormFields0(11) = "LastName"
arFormDBFields0(11) = "LastName"
arFormValues0(11) = Request("LastName")
arFormFields0(12) = "Info_Partner"
arFormDBFields0(12) = "Info_Partner"
arFormValues0(12) = Request("Info_Partner")
arFormFields0(13) = "CompanyName"
arFormDBFields0(13) = "Company"
arFormValues0(13) = Request("CompanyName")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"),
"Browser_type1"
End If
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"),
"Remote_computer_name1"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp1"
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 "Newsletter_Confirmation.asp"
End If
End If
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>SignUp Newsletter</title>
</head>
<body topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0"
marginwidth="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111" width="770" id="AutoNumber1">
<tr>
<td width="765">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber2">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber3">
<tr>
<td width="550" class="blank" valign="top">
<object classid="clsid
27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=6,0,0,0" width="550" height="91" id="flash_main1" align>
<param name="movie" value="flash_main1.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<embed src="flash_main1.swf" quality="high" bgcolor="#FFFFFF"
width="550" height="91" name="flash_main1" align
type="application/x-shockwave-flash"
pluginspage="
http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
</td>
<td width="215" align="center">
<!--webbot bot="Include" u-include="include_logo.htm"
tag="BODY" --></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber4">
<tr>
<td background="images/topbar_back.gif" width="35"> </td>
<td background="images/topbar_back.gif" width="439">
<!--webbot bot="Include" u-include="include_globalmenu.htm"
tag="BODY" --></td>
<td background="images/topbar_back.gif" width="310"
align="right">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber16">
<tr>
<td align="center" width="28">
</td>
<td align="center" width="28">
</td>
<td align="center" width="28">
</td>
<td align="center" width="28">
</td>
<td align="center" width="28">
</td>
<td align="center" width="28">
<a title="Sign Up Newsletter" href="Sign_Up_News.htm">
<img border="0" src="images/icon05.gif" width="24"
height="25"></a></td>
<td align="center" width="28">
<a title="Member Sign In" href="Test/SignIn.htm">
<img border="0" src="images/icon09.gif" width="24"
height="25" alt="Member Sign In"></a></td>
<td align="center" width="10"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" class="blank" background="images/topbar2_back.gif"
height="5"> </td>
</tr>
<tr>
<td width="100%"> </td>
</tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber17">
<tr>
<td valign="top" width="10"> </td>
<td valign="top" width="190">
<table border="0" cellpadding="10" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber19">
<tr>
<td width="100%">
<p align="center">
<img border="0" src="images/Library.jpg" width="113"
height="117"></p>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber20" height="583">
<tr>
<td width="100%" valign="top" rowspan="3"> <form
method="POST" action="--WEBBOT-SELF--" name="Sing_Up_Newsletter">
<!--webbot bot="SaveDatabase" SuggestedExt="asp"
S-DataConnection="Logon" S-RecordSource="tb1Users"
U-Database-URL="_private/logon.mdb" S-Form-Fields="ConfirmPassword Terms
Info_Shalom Password JobTitle industry UserName Email FirstName department
Country LastName Info_Partner CompanyName" S-Form-DBFields="ConfirmPWD
AgreePolicy Info_Shalom PWD JobTitle Industry UID Email FirstName Department
Country LastName Info_Partner Company"
U-ASP-Include-Url="_fpclass/fpdbform.inc" startspan
S-Builtin-Fields="HTTP_USER_AGENT REMOTE_HOST Timestamp REMOTE_USER"
S-Builtin-DBFields="Browser_type1 Remote_computer_name1 Timestamp1
User_name" U-Confirmation-Url="Newsletter_Confirmation.asp" --><input
TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include
file="_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan
i-checksum="40548" -->
<table border="0" width="100%" id="table1">
<tr>
<td width="147" align="right">User Name:</td>
<td><input type="text" name="UserName" size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147" align="right">Password:</td>
<td><input type="password" name="Password"
size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147" align="right">Confirm Password:</td>
<td>
<input type="password" name="ConfirmPassword"
size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Email:</td>
<td><input type="text" name="Email" size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">First Name:</td>
<td><input type="text" name="FirstName"
size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Last Name:</td>
<td><input type="text" name="LastName" size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Job Title:</td>
<td><input type="text" name="JobTitle" size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Company Name:</td>
<td><input type="text" name="CompanyName"
size="20"></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Department:</td>
<td><SELECT name="department" size="1"><option
value="" SELECTED >-- Select your department --
<option value............
</select></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Industry:</td>
<td><select name="industry" size="1">
<option value......
</select></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147">
<p align="right">Country:</td>
<td><select name="Country" size="1">
<option value=.......
</select></td>
<td width="4"> </td>
</tr>
<tr>
<td width="147"> </td>
<td> </td>
<td width="4"> </td>
</tr>
</table>
<table border="0" width="100%" id="table2">
<tr>
<td width="60">
<p align="right">
<select size="1" name="Info_Shalom">
<option value="Yes" selected>Yes</option>
<option value="No">No</option>
</select><br>
</td>
<td>I wish to receive updated industry and service
information from Shalom International Consulting.</td>
<td width="4"> </td>
</tr>
<tr>
<td width="60">
<p align="right">
<select size="1" name="Info_Partner">
<option value="Yes">Yes</option>
<option selected value="No">No</option>
</select><br>
</td>
<td>I wish to receive promotional information from
carefully selected business partners.</td>
<td width="4"> </td>
</tr>
<tr>
<td width="60">
<p align="right">
<select size="1" name="Terms">
<option value="Yes">Yes</option>
<option value="No">No</option>
</select><br>
</td>
<td>I have read and agree terms of use and privacy
policy.</td>
<td width="4"> </td>
</tr>
<tr>
<td width="60"> </td>
<td><br>
<input type="submit" value="Submit"
name="Submit"><input type="reset" value="Reset" name="Reset"></td>
<td width="4"> </td>
</tr>
</table>
<p> </p>
</form>
</td>
<td height="37">
</td>
</tr>
<tr>
<td height="140">
<img border="0" src="images/image0.jpg" width="100"
height="140"></td>
</tr>
<tr>
<td height="406">
</td>
</tr>
</table>
<p>
<br>
</td>
<td valign="top" width="10"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" background="images/topbar_back.gif" align="center">
<!--webbot bot="Include" u-include="include_globalmenu.htm"
tag="BODY" --></td>
</tr>
<tr>
<td width="100%" align="center" height="30">
<!--webbot bot="Include" u-include="include_copyright.htm"
tag="BODY" --></td>
</tr>
</table>
</td>
<td width="5" background="images/shadow_right.gif"> </td>
</tr>
<tr>
<td class="blank" height="10"
background="images/shadow_bottom.gif"> </td>
<td class="blank" height="10">
<img border="0" src="images/shadow_corner.gif" width="5"
height="10"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>