DOCTYPE tag above CF's form validation javascript

Hi,
CF 8 seems to put the form validation javascript at the very top of the page, even before the HTML tag and the DOCTYPE validation tag.  This is causing problems with my style sheet.  Do you know of a way I can (at the very least), put my DOCTYPE tag above the javscript that CF renders?
Thank you,
David
<script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>
<!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">

Include the head tag, to entice Coldfusion to put the script tags there. Something like this
<!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><title>test page</title></head>
<body >
<cfform>
</cfform>
</body>
</html>

Similar Messages

  • How do I revise "if" syntax in form validation JavaScript?

    I added a script to my "Contact" page to validate any submitted email. Just one problem: the visitor is not required to give me their reply email if they don't want to. I want the script to validate if they input an email, but do nothing if they leave that form field blank. This should be easy, but as a result of having gotten into the habit of avoiding Web desgn that relies on JavaScript, I don't have the know-how to fix a script when I decide it's needed!  Link:
    http://www.keithpurtell.com/kthings/mail02.htm

    Just leave the conditional in but have it do nothing...
        if (fld.value == "") {
             // do nothing
        } else if (!emailFilter.test(tfld)) {         //test for illegal characters
            fld.style.background = 'Yellow';
            error = "Please enter a valid email address.\n";
        } else if (fld.value.match(illegalChars)) {
            fld.style.background = 'Yellow';
            error = "The email address contains illegal characters.\n";
        } else {
            fld.style.background = 'White';

  • Simultaneous Client and Server Form Validation using Custom Tag Library

    I am developing a custom tag library for validator tags
    which are capable of doing client side validation (Javascript)
    and server side (Java). My problem is with the development
    of a regular expression based validator. Because of differences
    in the way Javascript and Java handle regular expressions
    i can not use the same regular expression for both types of
    validation. Is there any way to convert a valid regular
    expression from the java.util.regex format into the Javascript
    format or vice versa? My major problems are with the (or, ||)
    statements and the user of backslashes.

    If you are speaking of RE syntax flavours, they are basically the same(namely perl5 flavour). Any expression that works in JS should work in j.u.regex too.
    Though, their usage is quite different.
    So, there is no need for convertion of expressions.
    But porting the code may be not so trivial.

  • PLEASE help with server-side form validation using PHP!!!

    I feel like im going round and round in circles with this, after looking into all sorts of server-side advice i've come to the conclusion that i want to validate my form using server-side validation with PHP.
    So my form has several drop down menu's and  textareas  (not all of them need validation). For the part of my form i would like to validate, all i want is the drop downs to have to be changed/selected. So just a simple message like "You must select an option" if customers haven't done so. For the textareas, they just need to be filled out, so a message like "Information required" to come up if customers haven't done so.
    I believe i need to create a PHP page say for example 'error.php' place  the validation code in there and set this part of the the form to -
    <form name="product"form action="error.php" method="post" class="product_form">
    BUT im getting really confused with creating the code for the error.php. Please please can anyone help me with this!!!???
    Here are the drop down menu's i need validation on, error message being "You must select an option",
    "figurine"
    "engraving"
    "font"
    and here are the textareas that need validating, error message "Information required",
    "test"
    "Name"
    "house"
    "line_1"
    "line_2"
    "county"
    "postcode"
    "tel"
    www.milesmemorials.com/product-GK1.html
    I'd really appreciate any help!!!

    Ness_quick wrote:
    Great thats good enough for me. In that case, would you please be able to help me create the javascript for the above validation?? If you could just help me create it for this page i can amend it for all the other pages. I'd really really appreciate it!!!
    Can you follow the below example?? Obviously AFTER validation has been successful you need to collect the information from the form and send it to the recipient email address...that's where you can use php. I'll check back tomorrow and see how you are doing.
    <!DOCTYPE HTML>
    <html><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Form validation</title>
    <!-- VALIDATE ORDER FORM  -->
    <script type="text/javascript">
    <!--
    function RequiredFormFields() {
        // inform customer to provide figurine choice
    var figurine = document.forms.product.figurine.value;
    if (figurine == "-- Select figurine --")
    alert("Please provide figurine choice");
    return false;
    // inform customer to provide engraving choice
    var engraving = document.forms.product.engraving.value;
    if (engraving == "-- Select engraving --")
    alert("Please provide engraving choice");
    return false;
    // inform customer to provide font choice
        var font = document.forms.product.font.value;
    if (font == "-- Select style --")
    alert("Please select font style");
    return false;
    // inform customer to provide their name
    var Name = document.forms.product.Name.value;
    if (Name == null || Name == "")
    alert("Please provide your name");
    return false;
    // inform customer to provide their house number/name
    var house = document.forms.product.house.value;
    if (house == null || house == "")
    alert("Please provide your house number/name");
    return false;
    } // end function
    -->
    </script>
    </head>
    <body>
    <form name="product" form action="processForm.php" method="post" class="product_form" onsubmit="return RequiredFormFields()">
    <p class="product_form_options">Choice of Figurine<br>
    <select name="figurine" class="productButton" id="figurine" onChange="Recalculate()">
    <option selected>-- Select figurine --</option>
    <option value="7031">Tropical Green Granite with bronze sacred heart figurine as pictured(&pound;7031)</option>
    <option value="5216">Tropical Green Granite with bronze effect sacred heart figurine (&pound;5216)</option>
    <option value="5216">Tropical Green Granite with reconstituded figurine MF122(&pound;5216)</option>
    </select>
    </p>
    <p class="product_form_options">Engraved Lettering<br>
    <select name="engraving" class="productButton" id="engraving" onChange="Recalculate()">
            <option selected>-- Select engraving --</option>
            <option value="2.30">Sandblast and enamel painted (&pound;2.30/letter)</option>
            <option value="2.80">Sandblast and guilded (&pound;2.80/letter)</option>
            <option value="2.20">Maintenance free (&pound;2.20/letter)</option>
            <option value="3.73">Traditionally hand cut and enamel painted (&pound;3.73/letter)</option>
            <option value="3.98">Traditionally hand cut and gilded (&pound;3.98/letter)</option>
            <option value="4.34">Raised lead and enamel painted (&pound;4.34/letter)</option>
            <option value="4.59">Raised lead and gilded (&pound;4.59/letter)</option>
          </select>
    </p>
    <p class="product_form_options">Letter/Font Style<br>    
          <select name="font" class="productButton" id="font" >
               <option selected>-- Select style --</option>
               <option value="Maintenance free">Maintenance free </option>
               <option value="White painted block">White painted block</option>
               <option value="White painted roman">White painted roman</option>
               <option value="White painted Script">White painted Script</option>
               <option value="White painted Celtic">White painted Celtic</option>
               <option value="White painted Nova">White painted Nova</option>
               <option value="Sliver painted block">Sliver painted block</option>
               <option value="Sliver painted roman">Sliver painted roman</option>
               <option value="Sliver painted Script">Sliver painted Script</option>
               <option value="Sliver painted Celtic">Sliver painted Celtic</option>
               <option value="Sliver painted Nova">Sliver painted Nova</option>
               <option value="Gold leaf painted block">Gold leaf painted block</option>
               <option value="Gold leaf painted roman">Gold leaf painted roman</option>
               <option value="Gold leaf painted Script">Gold leaf painted Script</option>
               <option value="Gold leaf painted Celtic">Gold leaf painted Celtic</option>
               <option value="Gold leaf painted Nova">Gold leaf painted Nova</option>
               <option value="Gold leaf painted Old English">Gold leaf painted Old English</option>
             </select>
             </p>
             <p>
    <p>Name<br>
    <input name="Name" type="text" id="Name" value="">
    </p>
    <p>House name or number:<br>
    <input name="house" type="text" id="house" size="67">
    </p>
    <p>
    <input name="submit" type="submit" class="place_order" id="submit" value="Place order">
    </p>  
    </form>
    </body>
    </html>

  • Reusable form validation

    Hi all,
    Whenever I work with form validation, I prefer to use manual
    ColdFusion validation rather than the automated cfform or
    Javascript validation.
    I have included a sample of one of my form validation scripts
    below, and was wondering if there was a way of scripting this whole
    thing, perhaps to loop through the form collection to perform the
    same sort of validation on the fields included in the collection.
    Is there some sort of attribute I can add to the fields that
    require validation to flag them to the loop?
    Thinking about it I would need something to flag minimum and
    maximum length, regular expressions, and replace() of fields on
    some occasions. Am I overcomplicating something for the sake of
    saving some coding time?
    Thanks in advance,
    Paul
    Attached code:

    What you could do is look for things you do frequently and
    write a custom tag/udf/cfc to make the code re-useable. For
    example, many of my forms just have two text boxes looking for
    dates. I have a custom tag that makes sure both values actually are
    dates, that they are in the correct order, that they are not too
    far apart, and that they are within a specified period.

  • Web Form Validation Message Language Setting at Runtime when work in multi lingual environment

    Business Catalyst use the default culture language to display web form validation message.
    When we are in multi lingual environment and not using subdoamin to handle multilingual sites, we found that the validation message did appear in the default culture setting. To make this work, we need to add the below script in our template.
    <script type="text/javascript">
    $(document).ready(function(){               
    var head= document.getElementsByTagName('head')[0];
    var script= document.createElement('script');
    script.src= '/BcJsLang/ValidationFunctions.aspx?lang=FR';
    script.charset = 'utf-8';
    script.type= 'text/javascript';
    head.appendChild(script);
    </script>
    Assuming the template is in french. You can change the lang parameter in the script according to your language.

    After user 1 submits the page, it might not even be committed, so there is no way to have the pending data from user1 seen by user2.
    However, we do have a new feature in ADF 11g TP4 that I plan to blog more about called Auto-Refresh view objects. This feature allows a view object instance in a shared application module to refresh its data when it receives the Oracle 11g database change notification that a row that would affect the results of the query has been changed.
    The minimum requirements in 11g TP4 to experiment with this feature which I just tested are the following:
    1. Must use Database 11g
    2. Database must have its COMPATIBLE parameter set to '11.0.0.0.0' at least
    3. Set the "AutoRefresh" property of the VO to true (on the Tuning panel)
    4. Add an instance of that VO to an application module (e.g. LOVModule)
    5. Configure that LOVModule as an application-level shared AM in the project properties
    6. Define an LOV based on a view accessor that references the shared AM's VO instance
    7. DBA must have performed a 'GRANT CHANGE NOTIFICATION TO YOURUSER'
    8. Build an ADF Form for the VO that defined the LOV above and run the web page
    9. In SQLPlus, go modify a row of the table on which the shared AM VO is based and commit
    When the Database delivers the change notification, the shared AM VO instance will requery itself.
    However that notification does not arrive all the way out to the web page, so you won't see the change until the next time you repaint the list.
    Perhaps there is some way to take it even farther with the active data feature PaKo mentions, but I'm not familiar enough with that myself to say whether it would work for you hear.

  • Why is HTML showing in the form validation message?

    Here is what is showing when I use server side form validation.
    <ul><li>You must select a location </li></ul> Go <a href="javascript:history.back()">back</a> and correct the problem.
    Obviously, the HTML tags are not supposed to be shown.  What's going on here?  I just upgraded to CF9 on Linux and this started happening.  Any ideas?

    It's a standard CF server-side form validation and looks like this on the form:
    <input type="hidden" name="somefield_required" value="some field is a required field">
    When they submit the form (and didn't enter something for somefield), the automatic message comes up.  The formatting of the message is messed up on CF9.  I've been using this type of server-side validation for years (probably since CF5) and have never seen this problem before.
    Actually, this works fine on another server (CF 9,0,0,251028) but on CF 9,0,1,274733 it is having this issue.  Both are running CF Enterprise on Linux.
    Error message is supposed to look like this:
    Form entries are incomplete or invalid.
    some field is a required field
    Go back and correct the problem.
    The messed up message looks like this:
    Form entries are incomplete or invalid.
    <ul><li>some field is a required field</li></ul> Go <a href="javascript:history.back()">back</a> and correct the problem.

  • WL 8.1 BEA-101083 error when submitting a form using javascript (IE only)

    Hello,
    I have a JSP page that is submitting a form with javascript document.form.submit()
    after checking the validity of form element values, but I randomly get a BEA-101083
    error. The jsp page has worked fine for several year in IPlanet, and Sun One
    7 application server, but when ported over to WebLogic 8.1 SP2 the error manifests
    itself. Basically, when user submits the form, the next page is displayed with
    null values, and soon after the following stack trace appears in the server log.
    This error only occurs when the client browser is IE, Netscape works fine.
    Thanks,
    -Colin
    <WLS Kernel>> <> <BEA-101083> <Connection failure.
    java.io.IOException: A complete message could not be read on socket: 'weblogic.servlet.internal.MuxableSocketHTTP@9bb9300
    - idle tim
    eout: '30000' ms, socket timeout: '30000' ms', in the configured timeout period
    of '60' secs
    at weblogic.socket.SocketMuxer$TimeoutTrigger.trigger(Lweblogic.time.common.Schedulable;)V(SocketMuxer.java:775)
    at weblogic.time.common.internal.ScheduledTrigger.run()Ljava.lang.Object;(ScheduledTrigger.java:243)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.Privil
    egedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.a
    cl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:118)
    at weblogic.time.common.internal.ScheduledTrigger.executeLocally()V(ScheduledTrigger.java:229)
    at weblogic.time.common.internal.ScheduledTrigger.execute(Lweblogic.kernel.ExecuteThread;)V(ScheduledTrigger.java:223)
    at weblogic.time.server.ScheduledTrigger.execute(Lweblogic.kernel.ExecuteThread;)V(ScheduledTrigger.java:50)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
    at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)

    Checkboxes only submit a value when they are "on"
    They submit nothing if they are not selected.
    The problem comes - do you interpret no checkbox values as "clear all values" or "leave the values alone"? Struts assumes the latter.
    Your form is probably being kept in session?
    Try implementing the reset() method of your action form and set its property to be equivalent to no checkboxes selected.

  • Script for Form validator in head causes error

    When I use the Window/Behaveiors/ to create a form validator, Dreamweaver CS5 puts script in the Head of page, and seems to work ok. But when I validate page with W3c it says there are errors with code and as Dreamweaver created this I have no idea what to do to put right, so could someone please help. This is code generated by Dreamweaver, all other pages have past with flying colors!
    <script type="text/javascript">
    function MM_validateForm() { //v4.0
      if (document.getElementById){
        var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
        for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
          if (val) { nm=val.name; if ((val=val.value)!="") {
            if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
              if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
            } else if (test!='R') { num = parseFloat(val);
              if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
              if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
                min=test.substring(8,p); max=test.substring(p+1);
                if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
          } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
        } if (errors) alert('The following error(s) occurred:\n'+errors);
        document.MM_returnValue = (errors == '');
    </script>

    If the script is working fine in all browsers, you could put it in an external JS file and link to it, then the W3C validator won't find an error.
    If you don't know already, learn about how to do this:
    http://www.hypergurl.com/jsfiles.html

  • Form Validations

    How to perform form validations in ADF. And also can i customize the behaviour of "Required" property of a UIComponent? I dont want alert boxes to be shown Can i change that?

    you might want to think about using one of the popup LOV item types for your employee ID field. popup LOVs are great for cases where you don't want to weigh your page down w/large lists of values. about your validation, if you really want to do it client-side, then javascript's probably the way to go (search google for code). if you do that, though, let the record show that you'd have to fetch your valid values down to your page for your comparison logic, anyhow. i'd consider using a regular htmldb validation for your emp id field. you seemed concerned in your post with the page submission. i'm assuming that's because you didn't want processing to occur unless the validation passes. if that's the case, fear not, it's a simple matter to set your processing to occur only after your validations have passed. check out the available "Process Point"s and "Computation Point"s for htmldb Processes and Computations to see what i mean.
    hope this helps,
    raj

  • David Powers --- Regarding form validation with dreamweaver behaviors

    I am in the chapter teaching about form validation with the Zend Framework. I have done the entire lesson with the lesson files and everything works perfectly...
    but I went back to use the form valdation techniques for my own site and it is not working properly. In the book, Chapter 6 teaches how to create a user login and editing the database through the site. But in chapter seven the form validation does not build on top of this and therefore does not teach how to integrate the form validation with the registered user already set up.
    I have user registration completly working on my site and everything runs fine. I am trying to add the form validation but it is all completly ignored. When I leave a field blank it simply takes me to another blank page that reads "Column 'first_name' cannot be null"
    here is index.php code...
    <?php require_once('Connections/CSSU_Write.php'); ?>
    <?php require_once('Connections/CSSU_Read.php'); ?>
    <?php require_once('script/user_registration.php');
    ?>
    <?php
    if (isset($_POST['password'])) {
              $_POST['password'] = sha1($_POST['password']);
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO sign_up (first_name, family_name, user_email, password, gender, bday_month, bday_day, bday_year) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['last_name'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['gender'], "text"),
                           GetSQLValueString($_POST['bday_month'], "text"),
                           GetSQLValueString($_POST['bday_day'], "text"),
                           GetSQLValueString($_POST['bday_year'], "text"));
      mysql_select_db($database_CSSU_Write, $CSSU_Write);
      $Result1 = mysql_query($insertSQL, $CSSU_Write) or die(mysql_error());
      $insertGoTo = "login.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['email'])) {
      $loginUsername=$_POST['email'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "logoOutRedirect.php";
      $MM_redirectLoginFailed = "logoOutRedirect.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_CSSU_Write, $CSSU_Write);
      $LoginRS__query=sprintf("SELECT user_email, password FROM sign_up WHERE user_email=%s AND password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $CSSU_Write) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
              if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;               
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!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>CSSU</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div class="container">
      <div class="header">
      <div class="logo">
                <a href="index.php">
                  <h1/>
            .CSSU { UNIVERSITY; }
            </h1>
            <h2>
            <code><<code>!</code>-- Learn/Apply/Master --></code>
            </h2>
        </a>
      </div> 
        <!-- end .header --></div>
        <div class="headerBar">
        <div id="nav">
                  <ul id="links">
                      <a href="#"><li>CSSU</li></a>
                      <a href="#"><li>Classes</li></a>
                      <a href="#"><li>Pricing</li></a>
                      <a href="#"><li>Degree</li></a>
                  </ul>
        </div>
        <form name="form2" method="POST" action="<?php echo $loginFormAction; ?>" class="form2">
        <p>
            <label for="email" id="email" class="loginLabel">Email:</label>
            <input type="email" name="email" class="loginField" />
            <label for="password" id="password" class="loginLabel">Password:</label>
            <input type="password" name="password" class="loginField" />
                  <input type="submit" value="Log In" name="submit" class="submit login" />
        </p>
        </form>
        </div>
      <div class="container2">
      <div class="sidebar1">
        <h1>Sign Up</h1>
        <h2>Earn an Official CSS Masters Certification!</h2>
        <table>
        <form name="form1" method="POST" action="<?php echo $editFormAction; ?>" class="form1">
        <tr >
            <td class="formLabel"><label for="firstName" id="firstNameLabel" >First Name:</label>
                      <span>
                         <?php
                                  if ($_POST && isset($errors['first_name'])) {
                                            echo $errors['first_name'];
                                  ?>
                </span>
            </td>
            <td><input type="text" name="first_name" class="inputField" id="firstName" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="lastName" id="lastName" >Last Name:</label></td>
            <td><input type="text" name="last_name" class="inputField" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="yourEmail" id="yourEmail" >Your Email:</label></td>
            <td><input type="user_email" name="email" class="inputField" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="yourEmail2" id="yourEmail2">Re-enter Email:</label></td>
            <td><input type="email" name="reEnter_email" class="inputField" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="password" id="password">New Password:</label></td>
            <td><input type="password" name="password" class="inputField" /></td>
        </tr>   
        <tr>
            <td class="formLabel"><label for="gender" id="gender" class="formLabel">I am:</label></td>
          <td><select name="gender" class="selectMenu selectMenu1 gender">
              <option value="select">Select Sex:</option>
              <option value="male" name="male">Male</option>
              <option value="female" name="female">Female</option>
                        </select>
          </td>
              </tr>
               <tr>
            <td class="formLabel"><label for="bday">Birthday:</label></td>
               <td>
            <select name="bday_month" class="selectMenu selectMenu1 bday">
              <option value="male">Month:</option>
              <option value="January">January</option>
            </select>
    <select name="bday_day" class="selectMenu bday">
              <option value="Day">Day:</option>
              <option value="1">1</option>
                        </select>
    <select name="bday_year" class="selectMenu bday">
              <option value="Year">Year:</option>
            </select>
         </td>
        </tr>
        <tr>
                  <td class="submitTd" colspan="2"><input type="submit" value="Sign Up" name="submit" class="submit signup" /><td>
        </tr>
        <input type="hidden" name="MM_insert" value="form1" />
        </form>
        </table>
        <!-- end .sidebar1 --></div>
      <div class="content">
        <h1>CSSU</h1>
        <!-- end .content --></div>
      <div class="footer">
        <!-- end .footer --></div>
        </div> <!-- end container2 -->
      <!-- end .container --></div>
    </body>
    </html>
    And here is user_registration.php code just for the first_name field...
    <?php
    $errors = array();
    if ($_POST) {
      // run the validation script
      require_once('library.php');
      try {
              // main script goes here
              $val = new Zend_Validate_Regex('/^[a-z]+[-\'a-z ]+$/i');
              if (!$val->isValid($_POST['first_name'])) {
                $errors['first_name'] = 'Required field, no numbers';
      } catch (Exception $e) {
              echo $e->getMessage();
    And from here, here is the library.php code....
    <?php
    $library = '.../html/zend/library';
    set_include_path(get_include_path() . PATH_SEPARATOR . $library);
    require_once('Zend/Loader/Autoloader.php');
    try {
    Zend_Loader_Autoloader::getInstance();
      $write = array('host'     => 'hostname',
                                             'username' => 'cssu',
                                             'password' => 'password',
                                             'dbname'   => 'cssu');
      $read  = array('host'     => 'hostname',
                                             'username' => 'cssu',
                                             'password' => 'password',
                                             'dbname'   => 'cssu');
      // Comment out the next two lines if using mysqli
      // and remove the comments from the last two lines
      $dbWrite = new Zend_Db_Adapter_Pdo_Mysql($write);
      $dbRead = new Zend_Db_Adapter_Pdo_Mysql($read);
      //$dbWrite = new Zend_Db_Adapter_Mysqli($write);
      //$dbRead = new Zend_Db_Adapter_Mysqli($read);
    } catch (Exception $e) {
              echo $e->getMessage();
    I replaced some code here to protect myself, but the library.php file is completely functional and has been tested... I am sure the problem ins't in here.
    Please let me know if you need any further code to help you out. I am brand new to PHP and so far everything has ran smoothly up til now. I have my Zend Framework uploaded to my server and tested that my site is connecting to it properly. Any help on this would be so so awesome! This is for a school project and I can't move on until this is resolved! Thank you so much for trying!
    You can also view the issue at my website... all the files have been uploaded to the server. www.CSSU.com

    I am in the chapter teaching about form validation with the Zend Framework. I have done the entire lesson with the lesson files and everything works perfectly...
    but I went back to use the form valdation techniques for my own site and it is not working properly. In the book, Chapter 6 teaches how to create a user login and editing the database through the site. But in chapter seven the form validation does not build on top of this and therefore does not teach how to integrate the form validation with the registered user already set up.
    I have user registration completly working on my site and everything runs fine. I am trying to add the form validation but it is all completly ignored. When I leave a field blank it simply takes me to another blank page that reads "Column 'first_name' cannot be null"
    here is index.php code...
    <?php require_once('Connections/CSSU_Write.php'); ?>
    <?php require_once('Connections/CSSU_Read.php'); ?>
    <?php require_once('script/user_registration.php');
    ?>
    <?php
    if (isset($_POST['password'])) {
              $_POST['password'] = sha1($_POST['password']);
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO sign_up (first_name, family_name, user_email, password, gender, bday_month, bday_day, bday_year) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['first_name'], "text"),
                           GetSQLValueString($_POST['last_name'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['password'], "text"),
                           GetSQLValueString($_POST['gender'], "text"),
                           GetSQLValueString($_POST['bday_month'], "text"),
                           GetSQLValueString($_POST['bday_day'], "text"),
                           GetSQLValueString($_POST['bday_year'], "text"));
      mysql_select_db($database_CSSU_Write, $CSSU_Write);
      $Result1 = mysql_query($insertSQL, $CSSU_Write) or die(mysql_error());
      $insertGoTo = "login.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['email'])) {
      $loginUsername=$_POST['email'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "logoOutRedirect.php";
      $MM_redirectLoginFailed = "logoOutRedirect.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_CSSU_Write, $CSSU_Write);
      $LoginRS__query=sprintf("SELECT user_email, password FROM sign_up WHERE user_email=%s AND password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $CSSU_Write) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
              if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;               
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!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>CSSU</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div class="container">
      <div class="header">
      <div class="logo">
                <a href="index.php">
                  <h1/>
            .CSSU { UNIVERSITY; }
            </h1>
            <h2>
            <code><<code>!</code>-- Learn/Apply/Master --></code>
            </h2>
        </a>
      </div> 
        <!-- end .header --></div>
        <div class="headerBar">
        <div id="nav">
                  <ul id="links">
                      <a href="#"><li>CSSU</li></a>
                      <a href="#"><li>Classes</li></a>
                      <a href="#"><li>Pricing</li></a>
                      <a href="#"><li>Degree</li></a>
                  </ul>
        </div>
        <form name="form2" method="POST" action="<?php echo $loginFormAction; ?>" class="form2">
        <p>
            <label for="email" id="email" class="loginLabel">Email:</label>
            <input type="email" name="email" class="loginField" />
            <label for="password" id="password" class="loginLabel">Password:</label>
            <input type="password" name="password" class="loginField" />
                  <input type="submit" value="Log In" name="submit" class="submit login" />
        </p>
        </form>
        </div>
      <div class="container2">
      <div class="sidebar1">
        <h1>Sign Up</h1>
        <h2>Earn an Official CSS Masters Certification!</h2>
        <table>
        <form name="form1" method="POST" action="<?php echo $editFormAction; ?>" class="form1">
        <tr >
            <td class="formLabel"><label for="firstName" id="firstNameLabel" >First Name:</label>
                      <span>
                         <?php
                                  if ($_POST && isset($errors['first_name'])) {
                                            echo $errors['first_name'];
                                  ?>
                </span>
            </td>
            <td><input type="text" name="first_name" class="inputField" id="firstName" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="lastName" id="lastName" >Last Name:</label></td>
            <td><input type="text" name="last_name" class="inputField" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="yourEmail" id="yourEmail" >Your Email:</label></td>
            <td><input type="user_email" name="email" class="inputField" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="yourEmail2" id="yourEmail2">Re-enter Email:</label></td>
            <td><input type="email" name="reEnter_email" class="inputField" /></td>
        </tr>
        <tr>
            <td class="formLabel"><label for="password" id="password">New Password:</label></td>
            <td><input type="password" name="password" class="inputField" /></td>
        </tr>   
        <tr>
            <td class="formLabel"><label for="gender" id="gender" class="formLabel">I am:</label></td>
          <td><select name="gender" class="selectMenu selectMenu1 gender">
              <option value="select">Select Sex:</option>
              <option value="male" name="male">Male</option>
              <option value="female" name="female">Female</option>
                        </select>
          </td>
              </tr>
               <tr>
            <td class="formLabel"><label for="bday">Birthday:</label></td>
               <td>
            <select name="bday_month" class="selectMenu selectMenu1 bday">
              <option value="male">Month:</option>
              <option value="January">January</option>
            </select>
    <select name="bday_day" class="selectMenu bday">
              <option value="Day">Day:</option>
              <option value="1">1</option>
                        </select>
    <select name="bday_year" class="selectMenu bday">
              <option value="Year">Year:</option>
            </select>
         </td>
        </tr>
        <tr>
                  <td class="submitTd" colspan="2"><input type="submit" value="Sign Up" name="submit" class="submit signup" /><td>
        </tr>
        <input type="hidden" name="MM_insert" value="form1" />
        </form>
        </table>
        <!-- end .sidebar1 --></div>
      <div class="content">
        <h1>CSSU</h1>
        <!-- end .content --></div>
      <div class="footer">
        <!-- end .footer --></div>
        </div> <!-- end container2 -->
      <!-- end .container --></div>
    </body>
    </html>
    And here is user_registration.php code just for the first_name field...
    <?php
    $errors = array();
    if ($_POST) {
      // run the validation script
      require_once('library.php');
      try {
              // main script goes here
              $val = new Zend_Validate_Regex('/^[a-z]+[-\'a-z ]+$/i');
              if (!$val->isValid($_POST['first_name'])) {
                $errors['first_name'] = 'Required field, no numbers';
      } catch (Exception $e) {
              echo $e->getMessage();
    And from here, here is the library.php code....
    <?php
    $library = '.../html/zend/library';
    set_include_path(get_include_path() . PATH_SEPARATOR . $library);
    require_once('Zend/Loader/Autoloader.php');
    try {
    Zend_Loader_Autoloader::getInstance();
      $write = array('host'     => 'hostname',
                                             'username' => 'cssu',
                                             'password' => 'password',
                                             'dbname'   => 'cssu');
      $read  = array('host'     => 'hostname',
                                             'username' => 'cssu',
                                             'password' => 'password',
                                             'dbname'   => 'cssu');
      // Comment out the next two lines if using mysqli
      // and remove the comments from the last two lines
      $dbWrite = new Zend_Db_Adapter_Pdo_Mysql($write);
      $dbRead = new Zend_Db_Adapter_Pdo_Mysql($read);
      //$dbWrite = new Zend_Db_Adapter_Mysqli($write);
      //$dbRead = new Zend_Db_Adapter_Mysqli($read);
    } catch (Exception $e) {
              echo $e->getMessage();
    I replaced some code here to protect myself, but the library.php file is completely functional and has been tested... I am sure the problem ins't in here.
    Please let me know if you need any further code to help you out. I am brand new to PHP and so far everything has ran smoothly up til now. I have my Zend Framework uploaded to my server and tested that my site is connecting to it properly. Any help on this would be so so awesome! This is for a school project and I can't move on until this is resolved! Thank you so much for trying!
    You can also view the issue at my website... all the files have been uploaded to the server. www.CSSU.com

  • Adobe form validation with Print button

    Hi All,
    I have an adobe form with field validation (javascript) already set up but I'm trying to add one more feature to the validation.
    Let me explain my initial validation first:  I have 18 required fields with their tooltip name having an '*' at the end.  Any fields not filled in with this tooltip marker will show up on an alert message when the print button is selected.
    There are two fields called IException and Amount that are required but an End User might have additional IExceptions and corresponding Amounts.  Therefore I have created 5 textboxes for each but only the first IException and Amount are absolutely required (and I use a '*' within their tooltip).  Now if an End User has an additional IExceptions ("IException2") and fills out this field, I need to make it mandatory that "Amount2" would also have to be filled in.
    Here is my code: [code]
    function validateFields()
    var flg = 0
    var n = this.numFields
    var fArr = new Array();
    for(var i = 0;i<n;i++)
    var fn = this.getNthFieldName(i);
    var f = this.getField(fn);
    var tt = f.userName
    if(tt.indexOf('*')!=-1 && f.value == f.defaultValue)
    flg++;
    fArr[fArr.length] = tt;
    if(flg>0)
    app.alert('There are '+flg+' fields that require a value\n\n'+ fArr,3)
    var IException2 = document.getElementById('IException2').value;
    var Amount2 = document.getElementById('Amount2').value;
    if ((IException2.length >0) && (Amount2.length == 0))
    app.alert('Amount is missing')
    else
    document.ExceptionForm1.print();
    validateFields();
    [/code]
    Currently when one of the require fields is NOT filled in, i receive my first alert message.  If all required fields are filled in my print button doesn't work.  Also if all required fields are filled in and IException2 is also filled in but Amount2 is not, I don't receive my second Alert message.  So my code works up to the "Var IException2 = document....." and I don't know what the issue is.
    Thank you for your help in advance. 

    One more question,  since I have 4 of these...I'm having trouble getting the button to do exactly what its suppose to based on what's filled in because i think i have my '{ }' messed up and or IF/ELSE statement is wrong...can you please take a look..
    function validateFields()
    var flg = 0
    var n = this.numFields
    var fArr = new Array();
    for(var i = 0;i<n;i++)
    var fn = this.getNthFieldName(i);
    var f = this.getField(fn);
    var tt = f.userName
    if(tt.indexOf('*')!=-1 && f.value == f.defaultValue)
    flg++;
    fArr[fArr.length] = tt;
    if(flg>0)
    app.alert('There are '+flg+' fields that require a value\n\n'+ fArr,3)
    var a = this.getField('IException2').value;
    var b= this.getField('Amount2').value;
    if ((a.length >0) && (b.length == 0))
    app.alert('Since IException 2 is filled in, Amount 2 is also required')
    var c = this.getField('IException3').value;
    var d= this.getField('Amount3').value;
    if ((c.length >0) && (d.length == 0))
    app.alert('Since IException 3 is filled in, Amount 3 is also required')
    var e = this.getField('IException4').value;
    var f= this.getField('Amount4').value;
    if ((e.length >0) && (f.length == 0))
    app.alert('Since IException 4 is filled in, Amount 4 is also required')
    var g = this.getField('IException5').value;
    var h= this.getField('Amount5').value;
    if ((g.length >0) && (h.length == 0))
    app.alert('Since IException 5 is filled in, Amount 5 is also required')
    else
    this.print();
    validateFields();

  • Changing pop-up for form validating

    I have simple contact forms that are validated which makes sure the fields in the form are filled out and that it is a proper email address.
    I have 2 contact forms on the same page. On the first one the field name's and id's are "name", "email" and "question". If you click the submit button a pop-up come up with:
    The following error(s) occurred:
    - name is required.
    - email is required.
    - question is required.
    The second form has name's and id's are "name-main", "email-main" and "question-main". The pop-up comes up with:
    The following error(s) occurred:
    - name-main is required.
    - email-main is required.
    - question-main is required.
    The first one is OK but is their a way to change the second one to something more user friendly?

    snarble wrote:
    I am just using dreamweaver 5 form validator.
    Yeah, I just picked up your other thread so you can't use a 'class' as that's already assigned to the input tag.
    You could just forget the protocol about duplicating id's and repeat 'name' as the id for the second form. Only one form will be active at any given time.

  • Feedback form validation not working

    Hi all,
    My feedback form i am put form validation its not working, please help me,
    my entire code is given below
    <?php
              /* ========================= CODE WILL EXECUTE WHEN FORM WILL SUBMIT =====================*/
                        if($_GET["formFilledStatus"]=="t")
                                  $name = $_GET['txtName'];
                                  $email = $_GET['txtEmail'];
                                  $phone          =          $_GET['txtPhone'];
                                  $dateofappoitment          =          $_GET['txtDOA'];
                                  $timeofappoitment          =          $_GET['txtTA'];
                                  $userRequirement = $_GET['txtSuggestion'];
                                  $to= "[email protected]";
                                  $subject = "FEEDBACK & ENQUIRY FORM";
                                  $message = "<BR><B> User Name:- </B>".$name."<BR><BR><B> Email:- </B>".$email."<BR><BR><B> Phone:- </B>".$phone."<BR><BR><B>Date of Appoitment:-</B><BR>".$dateofappoitment."<BR><BR><B> Time of Appoitment:- </B>".$timeofappoitment."<BR><BR>                                <B> Address:- </B>".$userRequirement;
                                  $headers  = "MIME-Version: 1.0\r\n";
                                  $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
                                  $headers .= "From:".$email;
                                  // Additional headers
                                  //$headers .= 'Bcc: [email protected]' . "\r\n";
                                  $mailStatus=mail($to, $subject, $message, $headers);
                        /* ========================= END CODE =====================*/
    ?>
    <script language="javascript">
    function isEmail(email)
                        if(email.indexOf("@") != "-1" && email.indexOf(".") != "-1")
                        return true;
                        else
                        return false;
              function validate()
                        if(document.enquiryForm.txtName.value=="")
                                  alert("Name required!");
                                  document.enquiryForm.txtName.focus();
                                  return false;
                        if(document.enquiryForm.txtPhone.value=="")
                                  alert("Please Enter your Phone!");
                                  document.enquiryForm.txtPhone.focus();
                                  return false;
                        if(document.enquiryForm.txtDOA.value=="")
                                  alert("Please Select your date of appoitment!");
                                  document.enquiryForm.txtDOA.focus();
                                  return false;
                        if(document.enquiryForm.txtTA.value=="")
                                  alert("Please Enter time of appoitment!");
                                  document.enquiryForm.txtTA.focus();
                                  return false;
                        if(document.enquiryForm.txtSuggestion.value=="")
                                  alert("Please Enter your address!");
                                  document.enquiryForm.txtSuggestion.focus();
                                  return false;
    </SCRIPT>
    <style type="text/css">
    <!--
    .home_page_font {
              font-family: Verdana, Arial, Helvetica, sans-serif;
              font-size: 11px;
              font-style: normal;
              line-height: normal;
              font-weight: bold;
              font-variant: normal;
              text-transform: none;
              color: #333333;
              text-align: justify;
    .home_page_font1 {          font-family: Verdana, Arial, Helvetica, sans-serif;
              font-size: 11.6px;
              font-style: normal;
              line-height: normal;
              font-weight: normal;
              font-variant: normal;
              text-transform: none;
              color: #333333;
              text-align: justify;
    .home_page_font1 {          font-family: Verdana, Arial, Helvetica, sans-serif;
              font-size: 11px;
              font-style: normal;
              line-height: normal;
              font-weight: normal;
              font-variant: normal;
              text-transform: none;
              color: #868d98;
              text-align: justify;
    .style6 {color: #000000}
    -->
    </style>
            <FORM ACTION="" METHOD="GET" NAME="enquiryForm1" ONSUBMIT=" return validate()">
                        <INPUT TYPE="HIDDEN" NAME="formFilledStatus" VALUE="t">
                   <DIV ALIGN="LEFT">
            <TABLE WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="3" CELLSPACING="0" BORDERCOLOR="#F1D6D6" class="home_page_font1" STYLE="border-collapse:collapse;">
            <?php
                        /* ============ CODE IF MAIL SUCCESSFULLY SENT ====================== */
                        if($mailStatus)
                        ?>
                  <TR>
                <TD COLSPAN="2" HEIGHT="25">
                <DIV class="c-text1" ALIGN="CENTER"><b>
                <h3 class="style6">Your Enquiry Has Been Successfully Sent.<b></h3>
                </DIV></TD>
              </TR>
                          <?
                          /*================== CODE END ====================================== */
    ?>
                          <TR>
                <TD COLSPAN="2" HEIGHT="25">
                <DIV class="home_page_font" ALIGN="CENTER">
                  <div align="left">Suggestion &amp; Feedback Form</div>
                </DIV></TD>
              </TR>
              <TR>
                <TD class="power-com1"><FONT COLOR="#FF0000">* </FONT> <STRONG>Your
                Name :</STRONG></TD>
                <TD><INPUT NAME="txtName" SIZE="35" MAXLENGTH="48" VALUE="" class="txtfld"></TD>
              </TR>
              <TR>
                <TD class="power-com1"> </TD>
                <TD> </TD>
              </TR>
              <TR>
                <TD class="power-com1"><STRONG>Your
                E-Mail : </STRONG></TD>
                <TD><INPUT NAME="txtEmail" MAXLENGTH="48" SIZE="35" VALUE="" class="txtfld"></TD>
              </TR>
              <TR>
                <TD class="power-com1"> </TD>
                <TD> </TD>
              </TR>
              <TR>
                <TD class="power-com1"><FONT COLOR="#FF0000">* </FONT><STRONG>Phone/Mobile
                :</STRONG><br>(Include Country/Area Code)</TD>
                <TD><INPUT TYPE="TEXT" NAME="txtPhone" SIZE="22" MAXLENGTH="60" VALUE="" class="txtfld"></TD>
              </TR>
              <TR>
                <TD class="power-com1"> </TD>
                <TD> </TD>
              </TR>
              <TR>
                <TD class="power-com1"><STRONG><font color="#FF0000">*</font>Date of Appoitment :</STRONG><br>(Include Country/
                Area Code)</TD>
                <TD><INPUT TYPE="TEXT" NAME="txtDOA" SIZE="22" MAXLENGTH="60" VALUE="" class="txtfld" id="txtDOA"></TD>
              </TR>
              <TR>
                <TD class="power-com1"> </TD>
                <TD> </TD>
              </TR>
              <TR>
                <TD class="power-com1"><STRONG><font color="#FF0000">*</font>Time of Appoitment : </STRONG></TD>
                <TD><INPUT NAME="txtTA" SIZE="35" VALUE="" class="txtfld" id="txtTA"></TD>
              </TR>
              <TR>
                <TD class="power-com1"> </TD>
                <TD> </TD>
              </TR>
              <TR>
                <TD VALIGN="TOP" class="power-com1"> </TD>
                <TD> </TD>
              </TR>
              <TR>
                <TD VALIGN="TOP" class="power-com1"><FONT COLOR="#FF0000">* </FONT> <STRONG>Address</STRONG></TD>
                <TD><TEXTAREA NAME="txtSuggestion" ROWS="3" COLS="29" WRAP="Virtual" class="txtfld"></TEXTAREA></TD>
              </TR>
              <TR>
                <TD COLSPAN="2">
                <CENTER><INPUT TYPE="SUBMIT" NAME="" VALUE="Submit Query">
                <INPUT TYPE="RESET" NAME="Reset1"></CENTER></TD>
              </TR>
            </TABLE>
              </DIV></FORM>

    Rather than reinventing the wheel, I tend to use SpryValidation widgets to validate the form using JavaScript. However, to ensure that no validation is untouched, you also need to validate the inputs using serverside script.
    The example that you have shown is valiadtion in JavaScript. This means that anyone with JS turned off will bypass your validation.
    Gramps

  • WebAssist Form Validation Toolkit extension

    Hi everybody:
    I use WebAssist Form Validation Toolkit extension to validate
    my forms but any time I set everything in its wizard and I press OK
    the following error occurs: While executing onClick in
    WAFV_Server.htm, a JavaScript error occured.
    I tested it with dreamweaver 8 and dreamweaver mx 2004 both
    and the same error occured.
    The webassist validation toolkit extension version is 2.00.
    Please help me solve the problem. It is very critical for me.
    thanks
    Benign

    I use it all the time with 8.0.2 :-)
    Dave Buchholz
    I-CRE8
    www.i-cre8.co.uk
    Skype ID: I-CRE8
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:efqs2s$h9p$[email protected]..
    I have just used it on 8.0.2 with no problems.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Mark Fletcher *Adobe Community Expert*"
    <[email protected]> wrote in
    message news:efqi7n$78c$[email protected]..
    > Hello Bengin,
    >
    > If upgrading to the latest version of the Validation
    Toolkit does not
    > solve your problems, please contact me off-list
    >
    > Thanks to both Dave and Murray for helping out here.
    >
    > Regards,
    > Mark
    > ----------------------------------
    > Mark Fletcher
    > WebAssist.com
    > Email: [email protected]
    > ----------------------------------
    >
    > Benign wrote:
    >> Hi everybody:
    >> I use WebAssist Form Validation Toolkit extension to
    validate my forms
    >> but any time I set everything in its wizard and I
    press OK the following
    >> error occurs: While executing onClick in
    WAFV_Server.htm, a JavaScript
    >> error occured.
    >> I tested it with dreamweaver 8 and dreamweaver mx
    2004 both and the same
    >> error occured.
    >> The webassist validation toolkit extension version
    is 2.00.
    >> Please help me solve the problem. It is very
    critical for me.
    >> thanks
    >> Benign
    >>

Maybe you are looking for