[<<  <  >  >>]     view the code

Here is an example of Permanent VF-Diagnostics (abbreviated 'vfpd' or 'vfp-diagnostics') in a development environment.

What is your favorite integer between 8 and 20?

Unless vfp-diagnostics are on (or 'activated'), the JavaScript code for it is not downloaded. When the '[vfpd on]' link is visible, vfp-diagnostics are off.

TOP     The code [3/8]   (try it)     [<<  <  >  >>]

Printing out the closing 'form' tag ('</FORM>') within the SCRIPT block prevents empty lines from being printed in the vfpd-toolbar's place (when off/not displayed).

<SCRIPT LANGUAGE="JavaScript1.3" SRC="../../../js_stdc/validate_form.js" TYPE="text/javascript"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.3">
   configVF("CIBC_OFF", -1);
   configVFPD("OFF", "CIBC_OFF", "ON_LNK",
      [2, 1], ['RESET', 'Good', 'Bad']);

   function submitGoodValues(f_orm)  {

      f_orm.fav_int.sMsgRequired = "What's your favorite integer?";
         f_orm.fav_int.sMsgTxtInt = "Your favorite integer must be an *integer* between ~RANGE_MIN~ and ~RANGE_MAX~, inclusive.";
            f_orm.fav_int.iIntMin = 8;
            f_orm.fav_int.iIntMax = 20;

      var sErrors = getFormErrorMsgs(f_orm, '   - ');

      if(sErrors)  {
         alert('OOPS!\n\n' + sErrors);
         return false;

      }  else if(!doSubmitOnSuccess(f_orm))  {
         alert('HOORAY!\n\nForm "submitted" successfully.\n\n(Permanent VF Diagnostics are on, and doSubmitOnSuccess(f_orm) is false.)');
         return false;

      }  else  {
         return true;

   function vfpdtf__RESET()  {document.form_fav_int.fav_int.value = '';}
   function vfpdtf__Bad()  {document.form_fav_int.fav_int.value = 'not an integer';}
   function vfpdtf__Good()  {document.form_fav_int.fav_int.value = 15;}

   </HEAD><BODY onLoad="completeVFLoad();">

   <FORM NAME="form_fav_int" onSubmit="return submitGoodValues(this);" METHOD="post">
      What's your favorite integer between 8 and 20?  <INPUT TYPE="text" NAME="fav_int" SIZE="20">
      <BR><INPUT TYPE="submit" VALUE="Here you go">
<SCRIPT LANGUAGE="JavaScript1.3">



SourceForge.net Logo

Copyright (C) 2003-2005, Jeff Epstein.   All rights reserved.