POLL: PHP or JS for form validation.

I'm just getting started with my first from the ground up app
and still not sure which will serve me best. At this stage I'd rate
my skill level in each language about the same, intermediate. Since
both handle regex I can't decide if server-side or client-side is
the way to go. Or is there a place and need for each? I'm
interested in things like portability, compatibility, security,
speed and anything else you think is an important factor.
Would like to hear from people that have made this decision
and what benifits you feel you get from your choice.
Thanks in advance,
Mike D.

On 19 Jun 2007 in macromedia.dreamweaver.appdev, mdonahue
wrote:
> I'm just getting started with my first from the ground
up app and
> still not sure which will serve me best. At this stage
I'd rate my
> skill level in each language about the same,
intermediate. Since
> both handle regex I can't decide if server-side or
client-side is
> the way to go. Or is there a place and need for each?
I'm interested
> in things like portability, compatibility, security,
speed and
> anything else you think is an important factor.
>
> Would like to hear from people that have made this
decision and what
> benifits you feel you get from your choice.
Poll?
You absolutely, positively have to do validation serverside.
Javascript
validation can be avoided by the simple expedient of shutting
off
javascript. (For example, spambots which abuse forms don't
run
javascript.) Your only choice is to use some kind of
serverside
validation. If you want to do clientside validation with
javascript,
that's an added feature, but it's not necessary.
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/contact.php

Similar Messages

  • What is your strategy for form validation when using MVC pattern?

    This is more of a general discussion topic and will not necessarily have a correct answer. I'm using some of the Flex validator components in order to do form validation, but it seems I'm always coming back to the same issue, which is that in the world of Flex, validation needs to be put in the view components since in order to show error messages you need to set the source property of the validator to an instance of a view component. This again in my case seems to lead to me duplicating the code for setting up my Validators into several views. But, in terms of the MVC pattern, I always thought that data validation should happen in the model, since whether or not a piece of data is valid might be depending on business rules, which again should be stored in the model. Also, this way you'd only need to write the validation rules once for all fields that contain the same type of information in your application.
    So my question is, what strategies do you use when validating data and using an MVC framework? Do you create all the validators in the views and just duplicate the validator if the exact same rules are needed in some other view, or do you store the validators in the model and somehow reference them from the views, changing the source properties as needed? Or do you use some completely different strategy for validating forms and showing error messages to the user?

    Thanks for your answer, JoshBeall. Just to clarify, you would basically create a subclass of e.g. TextInput and add the validation rules to that? Then you'd use your subclass when you need a textinput with validation?
    Anyway, I ended up building sort of my own validation framework. Because the other issue I had with the standard validation was that it relies on inheritance instead of composition. Say I needed a TextInput to both check that it doesn't contain an empty string or just space characters, is between 4 and 100 characters long, and follows a certain pattern (e.g. allows only alphanumerical characters). With the Flex built in validators I would have to create a subclass or my own validator in order to meet all the requirements and if at some point I need another configuration (say just a length and pattern restriction) I would have to create another subclass which duplicates most of the rules, or I would have to build a lot of flags and conditional statements into that one subclass. With the framework I created I can just string together different rules using composition, and the filter classes themselves can be kept very simple since they only need to handle a single condition (check the string length for instance). E.g. below is the rule for my username:
    library["user_name"] = new EmptyStringFilter( new StringLengthFilter(4,255, new RegExpFilter(/^[a-z0-9\-@\._]+$/i) ) );
    <code>library</code> is a Dictionary that contains all my validation rules, and which resides in the model in a ValidationManager class. The framework calls a method <code>validate</code> on the stored filter references which goes through all the filters, the first filter to fail returns an error message and the validation fails:
    (library["user_name"] as IValidationFilter).validate("testuser");
    I only need to setup the rule once for each property I want to validate, regardless where in the app the validation needs to happen. The biggest plus of course that I can be sure the same rules are applied every time I need to validate e.g. a username.
    The second part of the framework basically relies on Chris Callendar's great ErrorTipManager class and a custom subclass of spark.components.Panel (in my case it seemed like the reasonable place to put the code needed, although perhaps extending Form would be even better). ErrorTipManager allows you to force open a error tooltip on a target component easily. The subclass I've created basically allows me to just extend the class whenever I need a form and pass in an array of inputs that I want to validate in the creationComplete handler:
    validatableInputs = [{source:productName, validateAs:"product_name"},
                         {source:unitWeight, validateAs:"unit_weight", dataField:"value"},
                   {source:unitsPerBox, validateAs:"units_per_box", dataField:"value"},
                        {source:producer, validateAs:"producer"}];
    The final step is to add a focusOut handler on the inputs that I want to validate if I want the validation to happen right away. The handler just calls a validateForm method, which in turn iterates through each of the inputs in the validatableInputs array, passing a reference of the input to a suitable validation rule in the model (a reference to the model has been injected into the view for this).
    Having written this down I could probably improve the View side of things a bit, remove the dependency on the Panel component and make the API easier (have the framework wire up more of the boilerplate like adding listeners etc). But for now the code does what it needs to.

  • 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

  • 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.

  • PHP dynamic content for form list field on tabbed panel

    I have been trying to use PHP dynamic content to populate a
    form list field. Works fine on a regular page, but doesn't seem to
    work (or works very erratically) if the form is on a tab of a Spry
    tabbed panel. Erratically means (as I've observed) the values will
    appear if the list field is the second on a tab but not the first.
    Haven't tried three on a tab... Anyone know if this is supposed to
    work?

    Thank You !!! to both of you above.
    Shant,
    The scheme youv'e proposed makes sense and I had thought of the same before posting the question. I already did a little POC on it but then realised this works if I can use complete list of values of 1st Field to decide the value of 2nd and so forth. But I rather need to know which one among those was clicked. Moreover, my right side list is usually not null when page loads for the first time (bcoz Field name is a path exp).
    Also, the real problem here is that, when I click on different values on the right side of multi-select(already selected values) of 1st Field, allowedValues and Derivation of 2nd should change. That GUI event is not capturable from whatever I've been able to read (onClick is not applicable for MultiSelect, and onChange doesn't serve my purpose, coz I need to know what value was clicked on).
    The solution I thought and implemented was to take the right side of multi-select, into an extra (read redundant), single-select Field. And then have the 2nd multi-select depend on it via Derivation and allowedValues.
    Having two redundant single-selects, isn't the most elegant solution but I can't think of anything better. Any thoughts ???
    If I'm not really overlooking something MultiSelect class should have an extra Property exposed....
    - AndyDev
    Edited by: AndyDev on Nov 6, 2007 2:04 PM

  • PHP Form Validation and Radio Group

    Hi David,
    I'm trying to set the initial state of a radio group to none.
    Please look at the file http://ecopethandbags.com/contact.php. The initial state is set to "No"
    In Dreamweaver, I've set the initial state to "Unchecked"
    I don't understand the code for the radio buttons in my file (see attachment).
    What I am trying to do is to have the radio group initially unchecked but required.
    I have 2 questions:
    1) - How can I control the initial status of the radio group when I use the PHP form validation?
    2) - How can I set the validation so, when one of the radio buttons is not checked by the user, a warning flag like "Please make a choice" comes up.
    Thank you much!

    Just change the following section of code:
    <?php
    if (!$_POST || isset($missing) && $_POST['subscribe'] == 'n') {
      echo 'checked="checked"';
    } ?>
    Remove the !$_POST || like this:
    <?php
    if (isset($missing) && $_POST['subscribe'] == 'n') {
      echo 'checked="checked"';
    } ?>
    The checked="checked" will be inserted into the code only if the form has been submitted, but neither radio button has been selected.

  • PHP Form Validation and Insert Records

    Hi There,
    I've been scratching my head for 2 days and couldn't find a solution.
    Here is my problem:
    Go to http://ecopethandbags.com/contactTest.php and click the "Send Comments" button.
    You will see that the validation works.
    Now, go to http://ecopethandbags.com/contactTestInsert.php, this time, I've inserted the "Insert Record" server behavior.
    Click the "Send Comments" button again.
    You will see the ugly message like "Column 'firstname' cannot be null" in a plain white page.
    My question is:
    How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
    I am attaching the files.
    Thank you for you help!

    boloco wrote:
    My question is:
    How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
    Use simple PHP logic to merge the scripts together.
    Dreamweaver automatically puts the Insert Record server behavior code at the top of the script. You need to adapt it so that the validation is done first. If the validation succeeds, use the Insert Record server behavior. If not, redisplay the form.
    if (array_key_exists('send', $_POST)) {
      // validate the form input
      if (!$suspect && empty($missing)) {
      // send the mail
        if ($mailSent) {
        unset($missing);
        // insert the Insert Record server behavior code here

  • Spry Form Validation doesn´t with PHP

    Hi guys!
    Houston, I have a problem!
    Description:
    I used a validation form for an e mail text field that works on .html file but not on a .php file.
    What I did?
    1.       I created my .html file and code all the Spry Valitation Form. If you test it, it works. This is the testing site link:
    a.      http://www.rayacosta.com/clientes/pparquitectura/v1/contactoT.html
    b.      The e mail field it´s the one that I’m validating.
    2.      I created 2 include files from the first one. One with the header info in header.php and another called footer.php. I need to use PHP to generate the form, so I thought it was the best way to go.
    3.      I create a contato.php file with:
    a.      header.php (here I included the links for the Spy Assets)
    b.      footer.php (with the footer info).
    4.      Here the file just doesn´t work. This is the link:
    http://www.rayacosta.com/clientes/pparquitectura/v1/contacto.php
    5.      Any clues? I understand that Dreamweaver doesn´t show the Spry UI in the php file. But it supposed to be compiled correctly on the browser agent. The other files just work fine, but not this contact form.
    6.      In Dreamweaver, if you see at the header.php file, the link to the js file is not totally brown like in its html version.
    I really appreciate some light in this matter.
    Thanks in advanced,
    Ray

    Two possibilities that I can see.
    1: Your HTML code has some JavaScript right near the bottom. This appears to be related to the Spry Validation of the email field. This same script does not seem to be in the PHP file.
    2:  Are the "header" and "footer" in the same folder as the contact page? If not (ie: if in an "files" or "includes" folder") the path to the spry files in the header would be wrong.
    For example, if the header file is one folder deep, change this:
    "_spryAssets/SpryValidationTextField.js" to  "../_spryAssets/SpryValidationTextField.js"
    When you view source when looking at a page, you can see the page as it is generated. Quite often it will reveal what is missing.
    Good luck.

  • 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>

  • Form validation for sql submission

    is there a way i can take the fields of my forms and replace any instance of ' with /' so that it can be submitted to my Postgres database successfully? i've come across a basic javascript function that replaced "a" with "z" and i tried modifing that, but it crashes my browser.
    surely being a common requirement for form submission for database entry, there must be a function written somewhere that handles this
    i know its not strickly java, but its something anyone that has developed in JSP, PHP or whatever must have come across

    is this a JavaScript question or a Java queston ?

  • On Sales Order form Validation for selection tax category as Form C

    Hi All Experts,
    Please help me out for the Validation on Sales Order Form that if CST (Central Sale Tax) Sales Tax code Selected in the transaction form should not get added (Posted into the system) till the Tax Category in the Tax Tab is not selected with Form C.
    Thanks in advance...
    Arinjay Shah

    hi,
    In sales order,you can manually update transaction category even after adding document,
    Why there is need for validaion,If u requires validation use approval procedure,since it
    can be activated only at header level.
    Use this query to trigger approval procedure
    Select DISTINCT 'True' Where $[RDR12.TransCat] IS NULL OR $[RDR12.TransCat] = ' '
    Jeyakanthan

  • 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

  • Captcha form validation ?

    Hi -
    Is there any plans to make the Captcha image form validator available for asp vbscript users as well?
    Bjørn-T

    Captcha is good until they hack around it.  I had a form with Capthca  that was being spam every other day.  I came up with an additional steps in the form processing code to check for spam if they get pass Captcha.
    1. Most spam has a link in the content.  I coded a loop that checks each form field that checks for the string url.
    foreach (string name in Request.Form.AllKeys)
                    if (name != "submit")
                        value = Request.Form[name];
                        checkvalue(value);
        public void checkvalue(string somevalue)
                    if (somevalue.IndexOf("[url=") != -1)
                        Response.Redirect("home.htm");
    2. To catch spam without the string url.  Most spam bots are dumb and they will place a value in every text in a form. So, I place a hidden field in the form that is blank.  In the form processing code, I check to see if that hidden field is still blank. If the hidden field has a value, I redirect the bot.
                string hiddentext= Request.Form["hiddentext"];
                if (hiddentext.Length > 1)
                    Response.Redirect("index.html");   //Wonder if I could redirect the bot to the FBI or cybercrime office
    Results:
       This web site does not have anymore spam.  This works great until the hackers figure it out.  The example code is written in C#, but can easy rewritten in PHP or Classis ASP.
    Note: the loop can be use to check for the bots that are trying to hack SQL databases by looking for the common SQL injections attacks strings like 'SET%20'.
    David Pearson
    www.saludalabs.com
    www.workhorsecreative.net

  • Can't find jquery form validator in Behaviors as shown in video demo

    I am on Win 8.1 using DW CC and am trying to add a validation script for my forms. According to the Video the New feature in DW CC has dropped the Spry scripts in favor of more standardized Jquery scripts for validation. Sounds great ...if they were there.... The Spry scripts are gone...but I can't find any Jquery replacements. This upgrade from 6 may have been a mistake.

    Use an HTML5 form with the jQuery Validate  like so:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title> HTML5 Form with jQuery Validation</title>
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <!--JQUERY LATEST-->
    <script src="http://code.jquery.com/jquery-latest.min.js">
    </script>
    <!--JQUERY VALIDATE-->
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js">
    </script>
    <style>
        /**put this into your CSS Reset**/
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
    body {
        font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
        font-size: 100%;
    /**BEGIN FORM STYLES**/
    form {
        font-size: 14px;
        width: 880px; /**adjust width in %, px or em*/
        margin: 0 auto; /**adjust margins as needed*/
        background: #FFF;
        padding: 2%;
    form fieldset {
        margin-bottom: 5px;
        background: #ADC9A5;
    form legend {
    display:block;
        padding: 8px;
        background: #537374;
        font-weight: bold;
        color: #FFF;
        line-height: 1.5;
    /**wrap form lables and fields inside ordered lists for better web accessibility**/
    form ol {
        list-style: none;
        margin: 0;
        padding: 0
    form li {
        padding: 5px;
        margin: 0;
        clear: left;
    form label {
        display: inline-block;
        float: left;
        line-height: 23px; /**lines up labels with fields**/
        width: 20%;
        font-size: 18px;
        text-align: right;
        margin-right: 10px; /*space between labels, fields*/
    form textarea, form input:not([type="submit"]) {
        width: 45%; /**same width on input fields**/
        padding: 5px;
        color: #333;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 18px;
        background: #F2F6DF;
    /**radio buttons, checkboxes**/
    form input[type=radio],
    form input[type=checkbox] {
        width: 1.5em;
        height: 1.5em;
        vertical-align: middle;
        display:inline-block;
    form select {
        width: 46.5%;
        background: #F2F6DF
    /**field background on focus**/
    form input:focus, form input:active,
    form textarea:focus, form textarea:active,
    form select:focus, form select:active { background-color: #DCEDBF; }
    form label.error {
        line-height: 1.5em;
        color: #FF4E51;
        background: #E0E4D8;
        padding: 5px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 1px 2px 3px #333;
    #submit {
        width: 25%;
        margin-left: 30%;
        height: 2.5em;
        font-size: 18px
    </style>
    </head>
    <body>
    <!--begin form-->
    <form action="path/your-form-processing-script.php" method="post">
    <h2>HTML5 Form with jQuery Validation</h2>
    <fieldset>
    <legend>Required Fields:</legend>
    <ol>
    <li>
    <label for="first_name">Name:</label>
    <input name="first_name" type="text" autofocus required id="first_name" placeholder="First">
    </li>
    <li>
    <label for="last_name">Last:</label>
    <input name="last_name" id="last_name" type="text" required placeholder="Last">
    </li>
    <li>
    <label for="e_mail">E-mail:</label>
    <input name="e_mail" id="e_mail" type="email" required placeholder="[email protected]">
    </li>
    <li>
    <label for="quantity">Quantity:</label>
    <input name="quantity" type="number" required id="quantity" placeholder="Min 5" min="5">
    </li>
    </ol>
    </fieldset>
    <fieldset>
    <legend>Select - Required:</legend>
    <ol>
    <li>
    <label for="MySelect">Select One:</label>
    <select name="MySelect" id="MySelect" size="4" required title="Please select something!">
    <option value="1">Audi</option>
    <option value="2">Saab</option>
    <option value="3">Fiat</option>
    <option value="4">BMW</option>
    </select>
    </li>
    </ol>
    </fieldset>
    <fieldset>
    <Legend>Radio buttons and Checkboxes - Required</Legend>
    <ol>
    <li>
    <label>Gender:</label>
    <label>
    <input name="RadioGroup1" type="radio" required title="??" id="RadioGroup1_0" value="male">
    Male</label>
    <label>
    <input type="radio" name="RadioGroup1" value="female" id="RadioGroup1_1">
    Female</label>
    </li>
    <li>
    <label>Select any:</label>
    <label>
    <input name="CheckboxGroup1" type="checkbox" required title="??" id="CheckboxGroup1_0" value="option1">
    Option 1 </label>
    <label>
    <input type="checkbox" name="CheckboxGroup1" value="option2" id="CheckboxGroup1_1">
    Option 2 </label>
    <label>
    <input type="checkbox" name="CheckboxGroup1" value="option3" id="CheckboxGroup1_2">
    Option 3 </label>
    </li>
    </ol>
    </fieldset>
    <fieldset>
    <legend>Optional Fields:</legend>
    <ol>
    <li>
    <label for="phone">Phone:</label>
    <input name="phone" id="phone" type="tel" placeholder="(area code) 123-4567" />
    </li>
    <li>
    <label for="subject">Subject:</label>
    <input name="subject" id="subject" type="text" />
    </li>
    <li>
    <label for="message">Message:</label>
    <textarea id="message" name="message" placeholder="remarks"></textarea>
    </li>
    <li>
    <label for="submit"></label>
    <input id="submit" name="submit" type="submit" value="SEND">
    </li>
    </ol>
    </fieldset>
    </form>
    <!--end form-->
    <!--invoke form validation-->
    <script>
    $(document).ready(function() {
        $("form").validate();
    </script>
    </body>
    </html>
    Nancy O.

  • Safari 5.0 AutoFill for Forms not working

    Safari 5.0 has broken the way AutoFill for forms works. I couldn't figure out why it kept entering inaccurate data on forms that I had previously filled out. I have the checkbox next to Other Forms checked (as well as the other two boxes for Address Book and User Names/Passwords). But it seemed to be pulling data from my Address Book INSTEAD of from forms I had previously filled out. To test it, I turned off the Address Book checkbox which resulted in it not AutoFilling anything at all.
    In 4.0 and previous versions, From Forms took priority over from Address Book. That's no longer the case and, in fact, From Forms doesn't seem to be working at all.
    Is there some cache file I should trash, or is this just another 5.0 bug?
    Other observations about 5.0:
    It's visibly slower than 4.0 (on a Mac Intel Core 2 Duo running OS X 10.5.8).
    Some pages refuse to load at all (http://www.radaronline.com/giveaways crashes every time; http://freebieswamp.com/game/index.php and http://tlc.discovery.com/sweepstakes/style-getaway/entryform.html load but their forms don't work; a few other pages just hang)
    Haven't noticed any improvements (and wish I had stuck with 4.0).

    HI,
    Haven't noticed any improvements (and wish I had stuck with 4.0).
    The first link you provided is outdated as far as web standards go. I checked the site with W3C Validator and it came up with numerous errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.radaronline.com%2Fgiveaways&c harset=%28detect+automatically%29&doctype=Inline&group=0
    As an aside. Sites with "giveaways" are notorious for malware.
    If it were me, in this case, I would keep Safari 5 for the security and privacy it provides. Reverting to a prior version merely for accessing sweepstakes sites in my opinion is a total waste of time.
    *You can revert to 4.0.5 if you wish but definitely try troubleshooting Safari 5 first.*
    First, go to ~/Library/Caches/com.apple.Safari and move the "cache.db" file to the Trash. ~ (Tilde) represents your Home Folder. Relaunch Safari. *That may make the difference*, if not....
    From the Safari Menu Bar, click Safari / Reset Safari. Select the top 7 buttons and click Reset.
    Relaunch Safari. If it functions as it should, great but if not...
    Go here for trouble shooting 3rd party plugins or input managers which might be causing the problem. Safari: Add-ons may cause Safari to unexpectedly quit or have performance issues
    If it isn't third party plugins, troubleshoot the Safari .plist file.
    Go to the Safari Menu Bar, click Safari/Preferences. Make note of all the preferences under each tab. Quit Safari. Now go to ~/Library/Preferences and move this file com.apple.safari.plist to the Desktop.
    Relaunch Safari and see if that makes a difference. If not, move the .plist file back to the Preferences folder. If Safari functions as it should, move that .plist file to the Trash.
    And if you didn't repair disk permissions after the update was installed, try that.
    Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    Now if you still want to revert to Safari 4.0.5, that's entirely up to you. Go here for instructions. http://appletoolbox.com/2010/06/downgrade-from-safari-5-0-to-safari-4-0-5/
    If you decide to revert to a prior version of Safari, make sure and backup all your important data first.
    Carolyn

Maybe you are looking for

  • How to change my mouse cursor?

    So it seems that my cursor is too small for easy location on my large screens. Is there any way to change it to be larger or more noticable like on a Windows system?

  • Selection screen default value maintain,user cant chage the default value

    hi Friends SELECTION-SCREEN  BEGIN OF BLOCK SCLDBLOCK WITH FRAME. SELECT-OPTIONS:   S_WERKS FOR EBAN-WERKS DEFAULT 'IN01' NO INTERVALS NO-EXTENSION ,                   S_MATNR FOR EBAN-MATNR,                   S_BANFN FOR EBAN-BANFN,                 

  • Can't publish a site

    i have created a web page. when i try to publish it i keeps giving me a window asking me to sign in to .mac account? i have done that allready? do i need to sync my .mac account? i tried that also and my computer won't let me sync? not sure why? is t

  • Diferencebetween report and script?

    cud anyone tell me the exact difference between script and report ? i dont want definition

  • Is it safe to delete .appmergegen files in /var/tmp anytime?

    Hi, I saw when I start an weblogic server, it writes deployment files in /var/tmp in exploded format. Do anybody has any idea on these files? and why weblogic writes these in /var/tmp? And can these be deleted anytime without restarting weblogic? e.g