Universal Form Validator PHP Support Product Page

This topic was archived

hint boxes and tooltips not displaying

Asked 23 Oct 2009 19:30:27
1
has this question
23 Oct 2009 19:30:27 Lucy Trustam posted:
I've recently purchased this extension. If it works it will make my life a whole lot easier, but can't seem to get it to work properly. I've noticed the following:
1. The styles menu is installed with a lower case 's' and the links relate to 'Styles'.
2. Everytime I update the server behaviour it removes the form action, ie changes it to this: action="".
3. I want to use tooltips with the hintboxes and display error messages in the 'speech bubble', but the hints are not displaying at all and the errors are displaying in a line below the text field.
4. The styles for correct or invalid entries don't work either.
I'll paste my source code in the next post, and would be realy greatful if you could shed some light on some or preferably all these issues.
Thank you.

url is as follows:
www.onespotcms.co.uk/contact.php
Edited by - Lucy Trustam on 23 Oct 2009  19:31:35

Replies

Replied 23 Oct 2009 19:32:59
23 Oct 2009 19:32:59 Lucy Trustam replied:
<?php require_once('Connections/cmsconn.php'); ?>
<?php require_once('ScriptLibrary/dmxValidator.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
?>
<?php
// Universal Form Validator PHP 1.5.0
$dmxval1 = new dmxValidator();
$dmxval1->script_folder = "ScriptLibrary";
$dmxval1->cs_validate_on_change = true;
$dmxval1->cs_validate_on_submit = true;
$dmxval1->report_type = 4;
$dmxval1->error_font =  "Arial";
$dmxval1->error_font_size = 10;
$dmxval1->error_color = "#D20000";
$dmxval1->error_bold = false;
$dmxval1->error_italic = false;
$dmxval1->error_image = "";
$dmxval1->error_fixed = "Styles/dmxValidator/Icons/error4.png";
$dmxval1->error_padding = 20;
$dmxval1->border_color = "#FF0000";
$dmxval1->border_style = "solid";
$dmxval1->css_error_file = "validatorError1";
$dmxval1->error_bg_color = "#ffffff";
$dmxval1->error_preset = "error_one.txt";
$dmxval1->tooltip_position = "top";
$dmxval1->css_hint_file = "validatorHint1";
$dmxval1->hint_preset = "blue.txt";
$dmxval1->hint_tooltip_position = "top";
$dmxval1->hint_border_color = "#000000";
$dmxval1->hint_border_style = "solid";
$dmxval1->hint_bg_color = "#FFFF88";
$dmxval1->hint_text_color = "#008C00";
$dmxval1->hint_text_font = "Verdana";
$dmxval1->hint_text_size = 12;
$dmxval1->hint_text_bold = false;
$dmxval1->hint_text_italic = false;
$dmxval1->hint_box_width = 200;
$dmxval1->hint_image = "";
$dmxval1->hint_fixed = "Custom";
$dmxval1->hint_padding = 4;
$dmxval1->use_custom_focus_class = "fixed";
$dmxval1->focus_border_style = "groove";
$dmxval1->focus_border_size = 1;
$dmxval1->focus_border_color = "#C3D9FF";
$dmxval1->focus_bg_color = "#CCCCCC";
$dmxval1->focus_text_color = "#000000";
$dmxval1->use_custom_valid_class = "fixed";
$dmxval1->valid_border_style = "groove";
$dmxval1->valid_border_size = 1;
$dmxval1->valid_border_color = "#00FF00";
$dmxval1->valid_bg_color = "#FFFFFF";
$dmxval1->valid_text_color = "#000000";
$dmxval1->use_custom_invalid_class = "fixed";
$dmxval1->invalid_border_style = "groove";
$dmxval1->invalid_border_size = 2;
$dmxval1->invalid_border_color = "#FF0000";
$dmxval1->invalid_bg_color = "#FFFFFF";
$dmxval1->invalid_text_color = "#000000";
$dmxval1->add_rule("contact", "SubFirstName", "letterscond", "true,,", "true", "First name is required", "", "", "");
$dmxval1->add_rule("contact", "SubLastName", "letterscond", "true,,", "true", "Last name is required", "", "", "");
$dmxval1->add_rule("contact", "SubTel", "alphanumericcond", "true,,", "true", "Telephone number is required", "", "", "");
$dmxval1->add_rule("contact", "SubEmail", "emailcond", ",,", "true", "Email address is required", "", "", "");
$dmxval1->add_rule("contact", "SubEmail2", "equalTocond", "SubEmail,,", "true", "Email address should be the same", "", "", "");
$dmxval1->add_hint("contact", "SubEmail", "Please supply your email address so I can get back to you");
$dmxval1->add_hint("contact", "SubEmail2", "Please confirm your email to avoid errors");
$dmxval1->add_hint("contact", "SubComments", "Please let me know your comments so that I might assist you");
$dmxval1->validate();
?>
<?php
mysql_select_db($database_cmsconn, $cmsconn);
$query_rsPages = "SELECT * FROM pages, pagetypes WHERE PageID = 7";
$rsPages = mysql_query($query_rsPages, $cmsconn) or die(mysql_error());
$row_rsPages = mysql_fetch_assoc($rsPages);
$totalRows_rsPages = mysql_num_rows($rsPages);

mysql_select_db($database_cmsconn, $cmsconn);
$query_rsCategories = "SELECT * FROM itemcategory WHERE CatActiveID=2";
$rsCategories = mysql_query($query_rsCategories, $cmsconn) or die(mysql_error());
$row_rsCategories = mysql_fetch_assoc($rsCategories);
$totalRows_rsCategories = mysql_num_rows($rsCategories);

mysql_select_db($database_cmsconn, $cmsconn);
$query_rsMenuTop = "SELECT menutop.MenuTopID, menutop.MenuTopName, menutop.MenuTopPageID, menutop.MenuTopOrder, menutop.MenuTopActiveID, pages.PageID, pages.PageName, pagetypes.TypeID, pagetypes.TypeName, pagetypes.TypeStylesheet FROM menutop, pages, pagetypes WHERE MenuTopActiveID=2 AND MenuTopMenuID=1 AND menutop.MenuTopPageID=pages.PageID AND menutop.MenuTopPageTypeID=pagetypes.TypeID ORDER BY menutop.MenuTopOrder";
$rsMenuTop = mysql_query($query_rsMenuTop, $cmsconn) or die(mysql_error());
$row_rsMenuTop = mysql_fetch_assoc($rsMenuTop);
$totalRows_rsMenuTop = mysql_num_rows($rsMenuTop);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $row_rsPages['PageMetaTitle']; ?></title>
<meta name="Description" content="<?php echo $row_rsPages['PageMetaDesc']; ?>']; ?>" />
<meta name="Keywords" content="<?php echo $row_rsPages['PageMetaKeywords']; ?>" />
<link href="stylesheet_general.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"><!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]></script>
<link rel="stylesheet" href="Styles/dmxValidator/validatorHint1.css" type="text/css" />
<link rel="stylesheet" href="Styles/dmxValidator/validatorError1.css" type="text/css" />
<script src="ScriptLibrary/jquery-latest.pack.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.inputHintBox.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.validate.min.js" type="text/javascript"></script>
<script src="ScriptLibrary/dmx.jquery.validate.js" type="text/javascript"></script>
<script src="ScriptLibrary/jsvat.js" type="text/javascript"></script>
<?php
// dmxValidatorJSStart
$dmxval1->generate_javascript_and_css();
// dmxValidatorJSEnd
?>
<script src="ScriptLibrary/jquery-latest.pack.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.inputHintBox.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script src="ScriptLibrary/jquery.validate.min.js" type="text/javascript"></script>
<script src="ScriptLibrary/dmx.jquery.validate.js" type="text/javascript"></script>
<script src="ScriptLibrary/jsvat.js" type="text/javascript"></script>
</head>

<body>
<div id="wrapper">
<div id="banner">
<div id="logo">[img]images/kisskisslogo.gif" alt="kiss kiss" /></div>
<div id="strapline">[img]images/strapline.gif" alt="CMS example store" /></div>
<div id="nav">

<?php include('includes/nav.php'); ?>
<!--banner ends--></div>
<div id="main">
<div id="content">
[h1]<?php echo $row_rsPages['PageHeading']; ?>[/h1]
<p><?php echo $row_rsPages['PageContent']; ?></p>
<form id="contact" name="contact" method="post" action="">
<table width="70%" border="0">
  <tr>
    <td>First Name</td>
    <td>
        <input name="SubFirstName" type="text" id="SubFirstName" value="<?php echo dmxSetValue("", "SubFirstName") ?>" size="40" /><br />
        <?php $dmxval1->generate_error("contact","SubFirstName","requiredcond","true,,");$dmxval1->generate_error("contact","SubFirstName","letterscond","true,,");?></td>
  </tr>
  <tr>
    <td>Last Name</td>
    <td><input name="SubLastName" type="text" id="SubLastName" value="<?php echo dmxSetValue("", "SubLastName") ?>" size="40" /><br />
      <?php $dmxval1->generate_error("contact","SubLastName","requiredcond","true,,");$dmxval1->generate_error("contact","SubLastName","letterscond","true,,");?>      </td>
  </tr>
  <tr>
    <td>Telephone</td>
    <td><input name="SubTel" type="text" id="SubTel" value="<?php echo dmxSetValue("", "SubTel") ?>" size="40" /><br />
      <?php $dmxval1->generate_error("contact","SubTel","requiredcond","true,,");$dmxval1->generate_error("contact","SubTel","alphanumericcond","true,,");?>      </td>
  </tr>
  <tr>
    <td>Email</td>
    <td><input name="SubEmail" type="text" id="SubEmail" value="<?php echo dmxSetValue("", "SubEmail") ?>" size="40" /><br />
          <?php $dmxval1->generate_error("contact","SubEmail","requiredcond",",,");$dmxval1->generate_error("contact","SubEmail","emailcond",",,");?>      </td>
  </tr>
  <tr>
    <td>Confirm Email</td>
    <td><input name="SubEmail2" type="text" id="SubEmail2" value="<?php echo dmxSetValue("", "SubEmail2") ?>" size="40" /><br />
      <?php $dmxval1->generate_error("contact","SubEmail2","requiredcond","SubEmail,,");$dmxval1->generate_error("contact","SubEmail2","equalTocond","SubEmail,,");?>      </td>
  </tr>
  <tr>
    <td>Comments</td>
    <td><textarea name="SubComments" cols="35" rows="5" id="SubComments"><?php echo dmxSetValue("", "SubComments") ?></textarea>
      </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
      
        <input type="submit" name="submit" id="submit" value="Submit" />
        
    
    </td>
  </tr>
</table></form>
<!--content ends--></div>

<?php include('includes/menu.php'); ?>


<!--main ends--></div>
<?php include('includes/footer.php'); ?>
<!--wrapper ends--></div>

</body>
</html>
<?php
mysql_free_result($rsPages);

mysql_free_result($rsCategories);

mysql_free_result($rsMenuTop);
?>
Replied 24 Oct 2009 12:20:10
24 Oct 2009 12:20:10 George Petrov replied:
Hi Lucy,

Could you please download and install the latest version 1.5.1
from www.dmxzone.com/go?16853

Seems you are using an older version.

Greetings,
George

Reply to this topic