-
Elements skipped error
<% response.buffer=true %>
<!--ASP-db-->
<html>
<head>
Please review the code below - when I validate (see line 6) I must set the state field to element 8 to get it's value - but I'm only showing 6 fields!
e.g. MyDb.dbEditFlds="name_used_for_dear,address_na me,address,city,state,zip"
It's seems that the field values starting a 0 skip so that field 1 is 2, field 2 is 4 etc. The odd number fields have no data returned!
Any suggestions or help??
<title>Christmas Validation!!</title>
<script language="javascript">
function EditValidate() {
NAMEOK=0;
num0=0;
m0=document.forms[0].elements[8].value;
num0=m0.valueOf();
if (num0 > " " {
NAMEOK=1; // good answer proceed
//alert(' state is ok ' );
} else {
alert ('
sorry, bad state - must be CA,
'
// return (false); // go back to form
}
if (NAMEOK == 1) {
alert ('
Good news
your ok! '
return (true);
} else {
document.write(num0 + "hello"
return (false); // go back to form
}
} // end of function
</script>
</head>
<body>
<p align="center">Welcome to an ASP-db Test Page.</p>
<p align="center"><%
'Set MyDb = Server.CreateObject("ASPdb.View" ' Create the ASP-db™ object (View or Pro)
Set MyDb = Server.CreateObject("ASPdb.Pro" ' Create the ASP-db™ object (View or Pro)
MyDb.dbMDB = Server.MapPath("christmas_list.mdb" ' Use YourFile.mdb in the current directory
MyDb.dbunit = 1
MyDb.dbImageDir="images/"
MyDb.dbColor = "6,auto" ' Pick color scheme 7, turn on Color button
MyDb.dbMode = "dual" ' Show it in both "grid" and "form" mode
MyDb.dbGridTableTag = "BORDER=2" ' Set the table BORDER to 3
madd= "San Bernardino"
response.write "the city is " & madd
MyDb.dbNavigationItem="top, bottom, next, prev, gridrow, color, filter, download, add, update, edit, delete"
MyDb.dbNavigationIcon="std"
MyDb.dbEditParams="TableName=[xmaslist,BookMarkFlds=mailinglistid,TableTag=BORDE R=2,editvalidatename=EditValidate()"
MyDb.dbEditFlds="name_used_for_dear,address_na me,address,city,state,zip" ' Note: You CANNOT include the AutoNumbered UniqueID field!
MyDb.dbfilterFlds="1,2"
'MyDb.dbSQL = "Select * FROM [christmas mailing list] where city ='" & madd & "'" & " order by zip"
MyDb.dbSQL = "Select * FROM [xmaslist]"
'MyDb.ASPdbView ' Tell ASP-db (View or Pro) to show the table!
MyDb.ASPdbpro' Tell ASP-db (View or Pro) to show the table!
%> </p><%=madd%>
</body>
</html>
-
Elements skipped error (reply)
Hi Mike,
Depending on whether you're in "simple" mode or not, the position / element
number of the fields will change. Easiest way to debug it is to modify
your validate function to spin thru a loop doing a document.write on all
the elements in the form (document.forms[0].elements[xx].value) where "xx"
is the index of your loop (starting at 0).
You'll see the values of each field displayed. When you're ready to debug,
fill out each field with values such as "a" "b" "c", etc. Then you'll know which elements correspond to which fields & which to validate in your code.
John
On 1/10/99 6:23:28 PM, Mike Cohen wrote:
> <% response.buffer=true %>
<!--ASP-db-->
<html>
<head>
Please review
> the code below - when I validate (see line 6) I must set the state field
> to element 8 to get it's value - but I'm only showing 6 fields!
>
e.g.
> MyDb.dbEditFlds="name_used_for_dear,address_na me,address,city,state,zip&
> #34;
It's seems that the field values starting a 0 skip so that
> field 1 is 2, field 2 is 4 etc. The odd number fields have no data
> returned!
Any suggestions or help??
<title>Christmas
> Validation!!</title>
<script language="javascript">
function
> EditValidate()
> {
NAMEOK=0;
num0=0;
m0=document.forms[0].elements[8].value;
num0=m0.valu
> eOf();
if (num0 > " " {
NAMEOK=1; // good answer
> proceed
//alert(' state is ok ' );
} else {
alert ('
>
sorry, bad state - must be CA,
'
// return (false); // go
> back to form
}
if (NAMEOK == 1) {
alert ('
Good news
your
> ok! '
return (true);
} else {
document.write(num0 +
> "hello"
return (false); // go back to form
}
} // end of
> function
</script>
</head>
<body>
<p align="center">Welcome to
> an ASP-db™ Test Page.</p>
<p align="center"><%
'Set MyDb
> = Server.CreateObject("ASPdb.View" ' Create the ASP-db™ object
> (View or Pro)
Set MyDb = Server.CreateObject("ASPdb.Pro" '
> Create the ASP-db™ object (View or Pro)
MyDb.dbMDB =
> Server.MapPath("christmas_list.mdb" ' Use YourFile.mdb in the
> current directory
MyDb.dbunit =
> 1
MyDb.dbImageDir="images/"
MyDb.dbColor = "6,auto" '
> Pick color scheme 7, turn on Color button
MyDb.dbMode = "dual"
> ' Show it in both "grid" and "form"
> mode
MyDb.dbGridTableTag = "BORDER=2" ' Set the table BORDER
> to 3
madd= "San Bernardino"
response.write "the city is "
> & madd
MyDb.dbNavigationItem="top, bottom, next, prev, gridrow, color,
> filter, download, add, update, edit,
> delete"
MyDb.dbNavigationIcon="std"
> MyDb.dbEditParams="TableName=[xmaslist,BookMarkFlds=mailinglistid,TableT
> ag=BORDER=2,editvalidatename=EditValidate()"
> MyDb.dbEditFlds="name_used_for_dear,address_na me,address,city,state,zip&
> #34; ' Note: You CANNOT include the AutoNumbered UniqueID
> field!
MyDb.dbfilterFlds="1,2"
'MyDb.dbSQL = "Select *
> FROM [christmas mailing list] where city ='" & madd &
> "'" & " order by zip"
MyDb.dbSQL = "Select * FROM
> [xmaslist]"
'MyDb.ASPdbView ' Tell ASP-db (View or Pro) to
> show the table!
MyDb.ASPdbpro' Tell ASP-db (View or Pro) to show the
> table!
%> </p><%=madd%>
</body>
</html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|