Results 1 to 2 of 2

Thread: Elements skipped error

  1. #1
    Mike Cohen Guest

    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&#39;s value - but I&#39;m only showing 6 fields!
    e.g. MyDb.dbEditFlds=&#34;name_used_for_dear,address_na me,address,city,state,zip&#34;

    It&#39;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=&#34;javascript&#34;>
    function EditValidate() {
    NAMEOK=0;
    num0=0;
    m0=document.forms[0].elements[8].value;
    num0=m0.valueOf();
    if (num0 > &#34; &#34 {
    NAMEOK=1; // good answer proceed
    //alert(&#39; state is ok &#39; );
    } else {
    alert (&#39;
    sorry, bad state - must be CA,

    &#39;
    // return (false); // go back to form
    }
    if (NAMEOK == 1) {
    alert (&#39;

    Good news

    your ok! &#39;
    return (true);
    } else {
    document.write(num0 + &#34;hello&#34
    return (false); // go back to form
    }
    } // end of function
    </script>
    </head>
    <body>
    <p align=&#34;center&#34;>Welcome to an ASP-db™ Test Page.</p>
    <p align=&#34;center&#34;><%
    &#39;Set MyDb = Server.CreateObject(&#34;ASPdb.View&#34 &#39; Create the ASP-db™ object (View or Pro)
    Set MyDb = Server.CreateObject(&#34;ASPdb.Pro&#34 &#39; Create the ASP-db™ object (View or Pro)
    MyDb.dbMDB = Server.MapPath(&#34;christmas_list.mdb&#34 &#39; Use YourFile.mdb in the current directory
    MyDb.dbunit = 1
    MyDb.dbImageDir=&#34;images/&#34;
    MyDb.dbColor = &#34;6,auto&#34; &#39; Pick color scheme 7, turn on Color button
    MyDb.dbMode = &#34;dual&#34; &#39; Show it in both &#34;grid&#34; and &#34;form&#34; mode
    MyDb.dbGridTableTag = &#34;BORDER=2&#34; &#39; Set the table BORDER to 3
    madd= &#34;San Bernardino&#34;
    response.write &#34;the city is &#34; & madd
    MyDb.dbNavigationItem=&#34;top, bottom, next, prev, gridrow, color, filter, download, add, update, edit, delete&#34;
    MyDb.dbNavigationIcon=&#34;std&#34;
    MyDb.dbEditParams=&#34;TableName=[xmaslist,BookMarkFlds=mailinglistid,TableTag=BORDE R=2,editvalidatename=EditValidate()&#34;
    MyDb.dbEditFlds=&#34;name_used_for_dear,address_na me,address,city,state,zip&#34; &#39; Note: You CANNOT include the AutoNumbered UniqueID field!
    MyDb.dbfilterFlds=&#34;1,2&#34;
    &#39;MyDb.dbSQL = &#34;Select * FROM [christmas mailing list] where city =&#39;&#34; & madd & &#34;&#39;&#34; & &#34; order by zip&#34;
    MyDb.dbSQL = &#34;Select * FROM [xmaslist]&#34;
    &#39;MyDb.ASPdbView &#39; Tell ASP-db (View or Pro) to show the table!
    MyDb.ASPdbpro&#39; Tell ASP-db (View or Pro) to show the table!
    %> </p><%=madd%>
    </body>
    </html>

  2. #2
    John Guest

    Elements skipped error (reply)

    Hi Mike,

    Depending on whether you&#39;re in &#34;simple&#34; 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 &#34;xx&#34;
    is the index of your loop (starting at 0).

    You&#39;ll see the values of each field displayed. When you&#39;re ready to debug,
    fill out each field with values such as &#34;a&#34; &#34;b&#34; &#34;c&#34;, etc. Then you&#39;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&#39;s value - but I&#39;m only showing 6 fields!
    >
    e.g.
    > MyDb.dbEditFlds=&#34;name_used_for_dear,address_na me,address,city,state,zip&
    > #34;

    It&#39;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=&#34;javascript&#34;>
    function
    > EditValidate()
    > {
    NAMEOK=0;
    num0=0;
    m0=document.forms[0].elements[8].value;
    num0=m0.valu
    > eOf();
    if (num0 > &#34; &#34 {
    NAMEOK=1; // good answer
    > proceed
    //alert(&#39; state is ok &#39; );
    } else {
    alert (&#39;
    >
    sorry, bad state - must be CA,

    &#39;
    // return (false); // go
    > back to form
    }
    if (NAMEOK == 1) {
    alert (&#39;

    Good news

    your
    > ok! &#39;
    return (true);
    } else {
    document.write(num0 +
    > &#34;hello&#34
    return (false); // go back to form
    }
    } // end of
    > function
    </script>
    </head>
    <body>
    <p align=&#34;center&#34;>Welcome to
    > an ASP-db™ Test Page.</p>
    <p align=&#34;center&#34;><%
    &#39;Set MyDb
    > = Server.CreateObject(&#34;ASPdb.View&#34 &#39; Create the ASP-db™ object
    > (View or Pro)
    Set MyDb = Server.CreateObject(&#34;ASPdb.Pro&#34 &#39;
    > Create the ASP-db™ object (View or Pro)
    MyDb.dbMDB =
    > Server.MapPath(&#34;christmas_list.mdb&#34 &#39; Use YourFile.mdb in the
    > current directory
    MyDb.dbunit =
    > 1
    MyDb.dbImageDir=&#34;images/&#34;
    MyDb.dbColor = &#34;6,auto&#34; &#39;
    > Pick color scheme 7, turn on Color button
    MyDb.dbMode = &#34;dual&#34;
    > &#39; Show it in both &#34;grid&#34; and &#34;form&#34;
    > mode
    MyDb.dbGridTableTag = &#34;BORDER=2&#34; &#39; Set the table BORDER
    > to 3
    madd= &#34;San Bernardino&#34;
    response.write &#34;the city is &#34;
    > & madd
    MyDb.dbNavigationItem=&#34;top, bottom, next, prev, gridrow, color,
    > filter, download, add, update, edit,
    > delete&#34;
    MyDb.dbNavigationIcon=&#34;std&#34;

    > MyDb.dbEditParams=&#34;TableName=[xmaslist,BookMarkFlds=mailinglistid,TableT
    > ag=BORDER=2,editvalidatename=EditValidate()&#34;

    > MyDb.dbEditFlds=&#34;name_used_for_dear,address_na me,address,city,state,zip&
    > #34; &#39; Note: You CANNOT include the AutoNumbered UniqueID
    > field!
    MyDb.dbfilterFlds=&#34;1,2&#34;
    &#39;MyDb.dbSQL = &#34;Select *
    > FROM [christmas mailing list] where city =&#39;&#34; & madd &
    > &#34;&#39;&#34; & &#34; order by zip&#34;
    MyDb.dbSQL = &#34;Select * FROM
    > [xmaslist]&#34;
    &#39;MyDb.ASPdbView &#39; Tell ASP-db (View or Pro) to
    > show the table!
    MyDb.ASPdbpro&#39; 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
  •