301 redirects and iWeb index page

Our site has grown and we will be changing our domain name and hosting co. (We are keeping the old domain active for a while at MME before we change domain name and hosting) I will need to redirect traffic for a while so as not to lose those who have just bookmarked us. Will just redirecting on the index page that iWeb creates (post publish) do that without creating a mess of our page rankings at Google? Currently we are in the top 15 responses for our search terms. Or should i create some other type of redirect? 301? (via cname or htaccess) will that ding me at google? Thanks- try to keep it as simple as possible - I don't code - I experiment and Apple has made it easy.
jy

What I would do is purchase the hosting and see if you can have more than one add-on domain. Most web hosts let you do this on one account so it doesn't cost you any more money. You are doing this because you will need a .htaccess file to set up your 301 redirects properly. This is what you should do;
1) Register your new domain and publish your site to it.
2) Create a webmaster tools account for BOTH your old and new domain name.
3) Create a 301 redirect for each individual page to the new corresponding page on your new domain. This can be done with a few lines in your .htaccess file. The file should be in your root folder of your OLD domain. Put this on your .htaccess file (NOTE: This assumes you will have the exact same website structure on the new domain);
RewriteEngine ON
RewriteRule ^(.*)$ http://mynewdomain.com/$1 \[R=301,L\]
OPTIONAL: Use Google's canonical tag on each one of your pages to avoid any issues with duplicate content. Link the old page to it's new corresponding page. This is optional but recommended if you can;
<link rel="canonical" href="http://www.newdomain.com/newpage.html" />
4) Login to your Webmaster Tools account and select your OLD domain. Then select 'Site Configuration' and then 'change of address'. Follow the steps provided (which are basically what I told you above). Step 4 in there is the important one.
5) Submit a sitemap for your new website. This will make sure you know when Google has indexed your new website.
6) Important: Even though you have done everything properly there is a chance your rankings will change. To help prevent this, update as many third party links as you can to your new site. This won't be possible for all links since you won't have control over them but you should try contacting the website owners who have linked to you to update their links. You should also try getting new links to your new domain.
You can find all the sites you have linked to you by logging into your webmaster tools account and clicking your OLD domain. Then go to 'Your site on the web' and then to 'Links to your site'.
Nothing will be instant here, it will take a few days for everything to update but the above is the way Google recommends you do it.
HTH

Similar Messages

  • Iweb index page

    i'm trying to make a simple index page leading to the rest of my pages
    when i create the links they work in iweb
    but when i publish them to .mac on the net they just open the image i've used?
    any help appreciated

    hi
    thanks you should see the page called simply index
    click on the graphic and it opens the graphic not the hyperlink as
    it does ok when in iweb
    http://web.mac.com/brendanmcevinney/iWeb/image/civil%20war%20news.html
    regards

  • Having trouble with blank "index" page

    I've published my site to a folder and transfered it succefully to my webhost. The only problem is that it shows up blank. I think because the index.html is blank when I open it on my harddrive to see the contents. I don't know html well enough to input the correct code to redirect from the webaddress people type in to the aboutme page I want them to see first.
    I thought the program iWeb would write the index for me.
    Any thoughts/suggestions will be greatly appreciated!

    I am having the same issue. Published to folder and then to my yahoo hosting and the index page does not instantly redirect to the home page as expected?
    On a mac it works just fine but PC browser shows blank page. Want this to be universal web access of course. Any help would be appreciated. Oh and if you wonder through the site there is nudity so be warned.
    http://garryirvine.com = fine on mac not on PC browser(blank)
    http://garryirvine.com/index.html worls on both. (redirects to home page from iweb project as expected [same for http://garryirvine.com/Home.html)
    The index page for me is not blank on my server it has the following(without "'s):
    "<?xml version="1.0" encoding="UTF-8"?><!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></title><meta http-equiv="refresh" content="0;url= Home.html" /></head><body></body></html>"

  • On a form w Validation, how to redirect to a custom page

    Hi. I have created a form in Dreamweaver CS5 that uses spry validation successfully. Once the form is submitted, the user is redirected to the home page. But I don't want that redirect.
    My question is, how can I have the validated page redirect to a custom thank you page I designed? I don't know the exact code/syntax to write to make it do what I want and, even if I had the code, I wouldn't know exactly where it should be placed. Please help if you can. Here's the source code. )BTW, when I use Dreamweaver Behaviors to add a URL redirect, it ignores the required validation and simply allows you to click the submit button and redirect.) Many thanks!
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="UTF-8">
    <link href="../_css/main.css" rel="stylesheet" media="screen, projection">
    <link href="../_css/forms.css" rel="stylesheet" media="screen, projection">
    <title></title>
    <!--[if lt IE 9]>
    <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script><![endif]-->
    <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
    <script type="text/javascript">
    <!-- **** I think the line of code for the redirect is here??...I just don't know how to write the code to redirect to the page I want ***** -->
    function MM_goToURL() { //v3.0
      var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
      for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    </script>
    </head>
    <body>
    <header id="pageHeader">
    <a href="../index.htm"><img src="../_images/logo.gif" width="170" height="91" alt="HMN logo" id="logo"></a>
    <img src="../_images/tagline.png" width="296" height="92" alt="HMN tagline" id="tagline">
    </header>
    <nav id="mainNav">
    <ul>
    <li><a href="../index.htm">Home</a></li>
    <li><a href="../press.htm">Press</a></li>
    <li><a href="../about.htm">About</a></li>
    <li><a href="../contact.htm">Contact</a></li>
    </ul>
    </nav>
    <br class="clear">
    <div class="headerContact">
    </div>
    <article>
      <!-- The file webformmailer.php sits on the web server at godaddy.com in case that matters -->
    <section id="Request">
    <p id="intro">To request your link for the downloadable <span id="highlight">Media Kit</span>, please provide the following information:</p>
    <form name="Request" method="post" action="../../webformmailer.php"> <p id="formCaption">Fields marked with * are required.</p>
      <p><span id="sprytextfield1">
        <label for="first_name">First Name:*</label>
        <input type="text" name="first_name" id="first_name">
        <span class="textfieldRequiredMsg">(required)</span></span></p>
      <p><span id="sprytextfield2">
        <label for="last_name">Last Name:*</label>
        <input type="text" name="last_name" id="last_name">
        <span class="textfieldRequiredMsg">(required)</span></span></p>
      <p><span id="sprytextfield3">
        <label for="company">Company:*</label>
        <input type="text" name="company" id="company">
        <span class="textfieldRequiredMsg">(required)</span></span></p>
      <p>
        <label for="address">Address:</label>
        <input type="text" name="address" id="address">
      </p>
      <p>
        <label for="address_2">Address 2:</label>
        <input type="text" name="address_2" id="address_2">
      </p>
      <p>
        <label for="city">City:</label>
        <input type="text" name="city" id="city">
      </p>
      <p>
        <label for="state">State:</label>
        <input type="text" name="state" id="state">
      </p>
      <p>
        <label for="zip">Zip:</label>
        <input type="text" name="zip" id="zip">
      </p>
      <p><span id="sprytextfield4">
      <label for="email">Email:*</label>
      <input type="text" name="email" id="email">
      <span class="textfieldRequiredMsg">(required)</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> </p>
      <p>
      <input name="submit" type="image" id="submit" onClick="MM_goToURL('parent','media_kit_download.htm');return document.MM_returnValue" src="../_images/btn_submit.png">
      </p>
      <p> </p>
    </form>
    <p>
    </p>
    </div>
    </div>
    </section>
    </article>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]});
    var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "none", {validateOn:["blur"]});
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email", {validateOn:["blur"]});
    </script>
    </body>
    </html>

    Thanks for replying. The  URL you've bolded is actually the correct page I'd like the redirect to go to when the form is successfully submitted after validation. But for some reason, that URL request is being ignored and the redirect brings me back to the index page in the root directory. I don't see anywhere in the code that makes the request to do that. Unless that's a default behavior if I've gotten the redirect wrong?
    I don't know if this is helpful, but there is also a .js file that Dreamweaver created and attached to the above HTML source file. The .js file appears to have all the spry code validation including code for features and widgets I'm not even using. I searched through the code several times trying to identify where there might be a redirect to the index page but didn't recognize anything that made sense to me. Here is the complete, unedited file:
    // SpryValidationTextField.js - version 0.38 - Spry Pre-Release 1.6.1
    // Copyright (c) 2006. Adobe Systems Incorporated.
    // All rights reserved.
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions are met:
    //   * Redistributions of source code must retain the above copyright notice,
    //     this list of conditions and the following disclaimer.
    //   * Redistributions in binary form must reproduce the above copyright notice,
    //     this list of conditions and the following disclaimer in the documentation
    //     and/or other materials provided with the distribution.
    //   * Neither the name of Adobe Systems Incorporated nor the names of its
    //     contributors may be used to endorse or promote products derived from this
    //     software without specific prior written permission.
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    // POSSIBILITY OF SUCH DAMAGE.
    (function() { // BeginSpryComponent
    if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
    Spry.Widget.BrowserSniff = function()
        var b = navigator.appName.toString();
        var up = navigator.platform.toString();
        var ua = navigator.userAgent.toString();
        this.mozilla = this.ie = this.opera = this.safari = false;
        var re_opera = /Opera.([0-9\.]*)/i;
        var re_msie = /MSIE.([0-9\.]*)/i;
        var re_gecko = /gecko/i;
        var re_safari = /(applewebkit|safari)\/([\d\.]*)/i;
        var r = false;
        if ( (r = ua.match(re_opera))) {
            this.opera = true;
            this.version = parseFloat(r[1]);
        } else if ( (r = ua.match(re_msie))) {
            this.ie = true;
            this.version = parseFloat(r[1]);
        } else if ( (r = ua.match(re_safari))) {
            this.safari = true;
            this.version = parseFloat(r[2]);
        } else if (ua.match(re_gecko)) {
            var re_gecko_version = /rv:\s*([0-9\.]+)/i;
            r = ua.match(re_gecko_version);
            this.mozilla = true;
            this.version = parseFloat(r[1]);
        this.windows = this.mac = this.linux = false;
        this.Platform = ua.match(/windows/i) ? "windows" :
                        (ua.match(/linux/i) ? "linux" :
                        (ua.match(/mac/i) ? "mac" :
                        ua.match(/unix/i)? "unix" : "unknown"));
        this[this.Platform] = true;
        this.v = this.version;
        if (this.safari && this.mac && this.mozilla) {
            this.mozilla = false;
    Spry.is = new Spry.Widget.BrowserSniff();
    Spry.Widget.ValidationTextField = function(element, type, options)
        type = Spry.Widget.Utils.firstValid(type, "none");
        if (typeof type != 'string') {
            this.showError('The second parameter in the constructor should be the validation type, the options are the third parameter.');
            return;
        if (typeof Spry.Widget.ValidationTextField.ValidationDescriptors[type] == 'undefined') {
            this.showError('Unknown validation type received as the second parameter.');
            return;
        options = Spry.Widget.Utils.firstValid(options, {});
        this.type = type;
        if (!this.isBrowserSupported()) {
            //disable character masking and pattern behaviors for low level browsers
            options.useCharacterMasking = false;
        this.init(element, options);
        //make sure we validate at least on submit
        var validateOn = ['submit'].concat(Spry.Widget.Utils.firstValid(this.options.validateOn, []));
        validateOn = validateOn.join(",");
        this.validateOn = 0;
        this.validateOn = this.validateOn | (validateOn.indexOf('submit') != -1 ? Spry.Widget.ValidationTextField.ONSUBMIT : 0);
        this.validateOn = this.validateOn | (validateOn.indexOf('blur') != -1 ? Spry.Widget.ValidationTextField.ONBLUR : 0);
        this.validateOn = this.validateOn | (validateOn.indexOf('change') != -1 ? Spry.Widget.ValidationTextField.ONCHANGE : 0);
        if (Spry.Widget.ValidationTextField.onloadDidFire)
            this.attachBehaviors();
        else
            Spry.Widget.ValidationTextField.loadQueue.push(this);
    Spry.Widget.ValidationTextField.ONCHANGE = 1;
    Spry.Widget.ValidationTextField.ONBLUR = 2;
    Spry.Widget.ValidationTextField.ONSUBMIT = 4;
    Spry.Widget.ValidationTextField.ERROR_REQUIRED = 1;
    Spry.Widget.ValidationTextField.ERROR_FORMAT = 2;
    Spry.Widget.ValidationTextField.ERROR_RANGE_MIN = 4;
    Spry.Widget.ValidationTextField.ERROR_RANGE_MAX = 8;
    Spry.Widget.ValidationTextField.ERROR_CHARS_MIN = 16;
    Spry.Widget.ValidationTextField.ERROR_CHARS_MAX = 32;
    /* validation parameters:
    *  - characterMasking : prevent typing of characters not matching an regular expression
    *  - regExpFilter : additional regular expression to disalow typing of characters
    *        (like the "-" sign in the middle of the value); use for partial matching of the currently typed value;
    *         the typed value must match regExpFilter at any moment
    *  - pattern : enforce character on each position inside a pattern (AX0?)
    *  - validation : function performing logic validation; return false if failed and the typedValue value on success
    *  - minValue, maxValue : range validation; check if typedValue inside the specified range
    *  - minChars, maxChars : value length validation; at least/at most number of characters
    Spry.Widget.ValidationTextField.ValidationDescriptors = {
        'none': {
        'custom': {
        'integer': {
            characterMasking: /[\-\+\d]/,
            regExpFilter: /^[\-\+]?\d*$/,
            validation: function(value, options) {
                if (value == '' || value == '-' || value == '+') {
                    return false;
                var regExp = /^[\-\+]?\d*$/;
                if (!regExp.test(value)) {
                    return false;
                options = options || {allowNegative:false};
                var ret = parseInt(value, 10);
                if (!isNaN(ret)) {
                    var allowNegative = true;
                    if (typeof options.allowNegative != 'undefined' && options.allowNegative == false) {
                        allowNegative = false;
                    if (!allowNegative && value < 0) {
                        ret = false;
                } else {
                    ret = false;
                return ret;
        'real': {
            characterMasking: /[\d\.,\-\+e]/i,
            regExpFilter: /^[\-\+]?\d(?:|\.,\d{0,2})|(?:|e{0,1}[\-\+]?\d{0,})$/i,
            validation: function (value, options) {
                var regExp = /^[\+\-]?[0-9]+([\.,][0-9]+)?([eE]{0,1}[\-\+]?[0-9]+)?$/;
                if (!regExp.test(value)) {
                    return false;
                var ret = parseFloat(value);
                if (isNaN(ret)) {
                    ret = false;
                return ret;
        'currency': {
            formats: {
                'dot_comma': {
                    characterMasking: /[\d\.\,\-\+\$]/,
                    regExpFilter: /^[\-\+]?(?:[\d\.]*)+(|\,\d{0,2})$/,
                    validation: function(value, options) {
                        var ret = false;
                        //2 or no digits after the comma
                        if (/^(\-|\+)?\d{1,3}(?:\.\d{3})*(?:\,\d{2}|)$/.test(value) || /^(\-|\+)?\d+(?:\,\d{2}|)$/.test(value)) {
                            value = value.toString().replace(/\./gi, '').replace(/\,/, '.');
                            ret = parseFloat(value);
                        return ret;
                'comma_dot': {
                    characterMasking: /[\d\.\,\-\+\$]/,
                    regExpFilter: /^[\-\+]?(?:[\d\,]*)+(|\.\d{0,2})$/,
                    validation: function(value, options) {
                        var ret = false;
                        //2 or no digits after the comma
                        if (/^(\-|\+)?\d{1,3}(?:\,\d{3})*(?:\.\d{2}|)$/.test(value) || /^(\-|\+)?\d+(?:\.\d{2}|)$/.test(value)) {
                            value = value.toString().replace(/\,/gi, '');
                            ret = parseFloat(value);
                        return ret;
        'email': {
            characterMasking: /[^\s]/,
            validation: function(value, options) {
                var rx = /^[\w\.-]+@[\w\.-]+\.\w+$/i;
                return rx.test(value);
        'date': {
            validation: function(value, options) {
                var formatRegExp = /^([mdy]+)[\.\-\/\\\s]+([mdy]+)[\.\-\/\\\s]+([mdy]+)$/i;
                var valueRegExp = this.dateValidationPattern;
                var formatGroups = options.format.match(formatRegExp);
                var valueGroups = value.match(valueRegExp);
                if (formatGroups !== null && valueGroups !== null) {
                    var dayIndex = -1;
                    var monthIndex = -1;
                    var yearIndex = -1;
                    for (var i=1; i<formatGroups.length; i++) {
                        switch (formatGroups[i].toLowerCase()) {
                            case "dd":
                                dayIndex = i;
                                break;
                            case "mm":
                                monthIndex = i;
                                break;
                            case "yy":
                            case "yyyy":
                                yearIndex = i;
                                break;
                    if (dayIndex != -1 && monthIndex != -1 && yearIndex != -1) {
                        var maxDay = -1;
                        var theDay = parseInt(valueGroups[dayIndex], 10);
                        var theMonth = parseInt(valueGroups[monthIndex], 10);
                        var theYear = parseInt(valueGroups[yearIndex], 10);
                        // Check month value to be between 1..12
                        if (theMonth < 1 || theMonth > 12) {
                            return false;
                        // Calculate the maxDay according to the current month
                        switch (theMonth) {
                            case 1:    // January
                            case 3: // March
                            case 5: // May
                            case 7: // July
                            case 8: // August
                            case 10: // October
                            case 12: // December
                                maxDay = 31;
                                break;
                            case 4:    // April
                            case 6: // June
                            case 9: // September
                            case 11: // November
                                maxDay = 30;
                                break;
                            case 2: // February
                                if ((parseInt(theYear/4, 10) * 4 == theYear) && (theYear % 100 != 0 || theYear % 400 == 0)) {
                                    maxDay = 29;
                                } else {
                                    maxDay = 28;
                                break;
                        // Check day value to be between 1..maxDay
                        if (theDay < 1 || theDay > maxDay) {
                            return false;
                        // If successfull we'll return the date object
                        return (new Date(theYear, theMonth - 1, theDay));   //JavaScript requires a month between 0 and 11
                } else {
                    return false;
        'time': {
            validation: function(value, options) {
                //    HH:MM:SS T
                var formatRegExp = /([hmst]+)/gi;
                var valueRegExp = /(\d+|AM?|PM?)/gi;
                var formatGroups = options.format.match(formatRegExp);
                var valueGroups = value.match(valueRegExp);
                //mast match and have same length
                if (formatGroups !== null && valueGroups !== null) {
                    if (formatGroups.length != valueGroups.length) {
                        return false;
                    var hourIndex = -1;
                    var minuteIndex = -1;
                    var secondIndex = -1;
                    //T is AM or PM
                    var tIndex = -1;
                    var theHour = 0, theMinute = 0, theSecond = 0, theT = 'AM';
                    for (var i=0; i<formatGroups.length; i++) {
                        switch (formatGroups[i].toLowerCase()) {
                            case "hh":
                                hourIndex = i;
                                break;
                            case "mm":
                                minuteIndex = i;
                                break;
                            case "ss":
                                secondIndex = i;
                                break;
                            case "t":
                            case "tt":
                                tIndex = i;
                                break;
                    if (hourIndex != -1) {
                        var theHour = parseInt(valueGroups[hourIndex], 10);
                        if (isNaN(theHour) || theHour > (formatGroups[hourIndex] == 'HH' ? 23 : 12 )) {
                            return false;
                    if (minuteIndex != -1) {
                        var theMinute = parseInt(valueGroups[minuteIndex], 10);
                        if (isNaN(theMinute) || theMinute > 59) {
                            return false;
                    if (secondIndex != -1) {
                        var theSecond = parseInt(valueGroups[secondIndex], 10);
                        if (isNaN(theSecond) || theSecond > 59) {
                            return false;
                    if (tIndex != -1) {
                        var theT = valueGroups[tIndex].toUpperCase();
                        if (
                            formatGroups[tIndex].toUpperCase() == 'TT' && !/^a|pm$/i.test(theT) ||
                            formatGroups[tIndex].toUpperCase() == 'T' && !/^a|p$/i.test(theT)
                            return false;
                    var date = new Date(2000, 0, 1, theHour + (theT.charAt(0) == 'P'?12:0), theMinute, theSecond);
                    return date;
                } else {
                    return false;
        'credit_card': {
            characterMasking: /\d/,
            validation: function(value, options) {
                var regExp = null;
                options.format = options.format || 'ALL';
                switch (options.format.toUpperCase()) {
                    case 'ALL': regExp = /^[3-6]{1}[0-9]{12,18}$/; break;
                    case 'VISA': regExp = /^4(?:[0-9]{12}|[0-9]{15})$/; break;
                    case 'MASTERCARD': regExp = /^5[1-5]{1}[0-9]{14}$/; break;
                    case 'AMEX': regExp = /^3(4|7){1}[0-9]{13}$/; break;
                    case 'DISCOVER': regExp = /^6011[0-9]{12}$/; break;
                    case 'DINERSCLUB': regExp = /^3(?:(0[0-5]{1}[0-9]{11})|(6[0-9]{12})|(8[0-9]{12}))$/; break;
                if (!regExp.test(value)) {
                    return false;
                var digits = [];
                var j = 1, digit = '';
                for (var i = value.length - 1; i >= 0; i--) {
                    if ((j%2) == 0) {
                        digit = parseInt(value.charAt(i), 10) * 2;
                        digits[digits.length] = digit.toString().charAt(0);
                        if (digit.toString().length == 2) {
                            digits[digits.length] = digit.toString().charAt(1);
                    } else {
                        digit = value.charAt(i);
                        digits[digits.length] = digit;
                    j++;
                var sum = 0;
                for(i=0; i < digits.length; i++ ) {
                    sum += parseInt(digits[i], 10);
                if ((sum%10) == 0) {
                    return true;
                return false;
        'zip_code': {
            formats: {
                'zip_us9': {
                    pattern:'00000-0000'
                'zip_us5': {
                    pattern:'00000'
                'zip_uk': {
                    characterMasking: /[\dA-Z\s]/,
                    validation: function(value, options) {
                        //check one of the following masks
                        // AN NAA, ANA NAA, ANN NAA, AAN NAA, AANA NAA, AANN NAA
                        return /^[A-Z]{1,2}\d[\dA-Z]?\s?\d[A-Z]{2}$/.test(value);
                'zip_canada': {
                    characterMasking: /[\dA-Z\s]/,
                    pattern: 'A0A 0A0'
                'zip_custom': {}
        'phone_number': {
            formats: {
                //US phone number; 10 digits
                'phone_us': {
                    pattern:'(000) 000-0000'
                'phone_custom': {}
        'social_security_number': {
            pattern:'000-00-0000'
        'ip': {
            characterMaskingFormats: {
                'ipv4': /[\d\.]/i,
                'ipv6_ipv4': /[\d\.\:A-F\/]/i,
                'ipv6': /[\d\.\:A-F\/]/i
            validation: function (value, options) {
                return Spry.Widget.ValidationTextField.validateIP(value, options.format);
        'url': {
            characterMasking: /[^\s]/,
            validation: function(value, options) {
                //fix for ?ID=223429 and ?ID=223387
                /* the following regexp matches components of an URI as specified in http://tools.ietf.org/html/rfc3986#page-51 page 51, Appendix B.
                    scheme    = $2
                    authority = $4
                    path      = $5
                    query     = $7
                    fragment  = $9
                var URI_spliter = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
                var parts = value.match(URI_spliter);
                if (parts && parts[4]) {
                    //encode each component of the domain name using Punycode encoding scheme: http://tools.ietf.org/html/rfc3492
                    var host  = parts[4].split(".");
                    var punyencoded = '';
                    for (var i=0; i<host.length; i++) {
                        punyencoded = Spry.Widget.Utils.punycode_encode(host[i], 64);
                        if (!punyencoded) {
                            return false;
                        } else {
                            if (punyencoded != (host[i] + "-")) {
                                host[i] = 'xn--' + punyencoded;
                    host = host .join(".");
                    //the encoded domain name is replaced into the original URL to be validated again later as URL
                    value = value.replace(URI_spliter, "$1//" + host + "$5$6$8");
                //fix for ?ID=223358 and ?ID=223594
                //the following validates an URL using ABNF rules as defined in http://tools.ietf.org/html/rfc3986 , Appendix A., page 49
                //except host which is extracted by match[1] and validated separately
                 * userinfo=    (?:(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=:]|%[0-9a-f]{2,2})*\@)?
                 * host=            (?:((?:(?:[a-z0-9][a-z0-9\-]*[a-z0-9]|[a-z0-9])\.)*(?:[a-z][a-z0-9\-]*[a-z0-9]|[a-z])|(?: \[[^\]]*\]))
                 * pathname=    (?:\/(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=\:\@]|%[0-9a-f]{2,2})*)*
                 * query=            (?:\?(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]|%[0-9a-f]{2,2})*)?
                 * anchor=        (?:\#(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]|%[0-9a-f]{2,2})*)?
                var regExp = /^(?:https?|ftp)\:\/\/(?:(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=:]|%[0-9a-f]{2,2})*\@)?(?: ((?:(?:[a-z0-9][a-z0-9\-]*[a-z0-9]|[a-z0-9])\.)*(?:[a-z][a-z0-9\-]*[a-z0-9]|[a-z])|(?:\[[^ \]]*\]))(?:\:[0-9]*)?)(?:\/(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=\:\@]|%[0-9a-f]{2,2})*)*( ?:\?(?:[a-z0-9\-\._~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]|%[0-9a-f]{2,2})*)?(?:\#(?:[a-z0-9\-\._ ~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]|%[0-9a-f]{2,2})*)?$/i;
                var valid = value.match(regExp);
                if (valid) {
                    //extract the  address from URL
                    var address = valid[1];
                    if (address) {
                        if (address == '[]') {
                            return false;
                        if (address.charAt(0) == '[' ) {
                            //IPv6 address or IPv4 enclosed in square brackets
                            address = address.replace(/^\[|\]$/gi, '');
                            return Spry.Widget.ValidationTextField.validateIP(address, 'ipv6_ipv4');
                        } else {
                            if (/[^0-9\.]/.test(address)) {
                                return true;
                            } else {
                                //check if hostname is all digits and dots and then check for IPv4
                                return Spry.Widget.ValidationTextField.validateIP(address, 'ipv4');
                    } else {
                        return true;
                } else {
                    return false;
    2.2.1. Preferred
    x:x:x:x:x:x:x:x, where the 'x's are the hexadecimal values of the eight 16-bit pieces of the address.
    Examples:
        FEDC:BA98:7654:3210:FEDC:BA98:7654:3210
        1080:0:0:0:8:800:200C:417A
    Note that it is not necessary to write the leading zeros in an
    individual field, but there must be at least one numeral in every
    field (except for the case described in 2.2.2.).
    2.2.2. Compressed
    The use of "::" indicates multiple groups of 16-bits of zeros.
    The "::" can only appear once in an address.  The "::" can also be
    used to compress the leading and/or trailing zeros in an address.
        1080:0:0:0:8:800:200C:417A --> 1080::8:800:200C:417A
        FF01:0:0:0:0:0:0:101 --> FF01::101
        0:0:0:0:0:0:0:1 --> ::1
        0:0:0:0:0:0:0:0 --> ::
    2.5.4 IPv6 Addresses with Embedded IPv4 Addresses
        IPv4-compatible IPv6 address (tunnel IPv6 packets over IPv4 routing infrastructures)
        ::0:129.144.52.38
        IPv4-mapped IPv6 address (represent the addresses of IPv4-only nodes as IPv6 addresses)
        ::ffff:129.144.52.38
    The text representation of IPv6 addresses and prefixes in Augmented BNF (Backus-Naur Form) [ABNF] for reference purposes.
    [ABNF http://tools.ietf.org/html/rfc2234]
          IPv6address = hexpart [ ":" IPv4address ]
          IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
          IPv6prefix  = hexpart "/" 1*2DIGIT
          hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ]
          hexseq  = hex4 *( ":" hex4)
          hex4    = 1*4HEXDIG
    Spry.Widget.ValidationTextField.validateIP = function (value, format)
        var validIPv6Addresses = [
            //preferred
            /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}(?:\/\d{1,3})?$/i,
            //various compressed
            /^[a-f0-9]{0,4}::(?:\/\d{1,3})?$/i,
            /^:(?::[a-f0-9]{1,4}){1,6}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){1,6}:(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,6}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,5}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,4}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}){1,3}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){5}(?::[a-f0-9]{1,4}){1,2}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){6}(?::[a-f0-9]{1,4})(?:\/\d{1,3})?$/i,
            //IPv6 mixes with IPv4
            /^(?:[a-f0-9]{1,4}:){6}(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
            /^:(?::[a-f0-9]{1,4}){0,4}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){1,5}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,4}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,3}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,    
            /^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,2}:(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i,
            /^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}):(?:\d{1,3}\.){3}\d{1,3}(?:\/\d{1,3})?$/i
        var validIPv4Addresses = [
            //IPv4
            /^(\d{1,3}\.){3}\d{1,3}$/i
        var validAddresses = [];
        if (format == 'ipv6' || format == 'ipv6_ipv4') {
            validAddresses = validAddresses.concat(validIPv6Addresses);
        if (format == 'ipv4' || format == 'ipv6_ipv4') {
            validAddresses = validAddresses.concat(validIPv4Addresses);
        var ret = false;
        for (var i=0; i<validAddresses.length; i++) {
            if (validAddresses[i].test(value)) {
                ret = true;
                break;
        if (ret && value.indexOf(".") != -1) {
            //if address contains IPv4 fragment, it must be valid; all 4 groups must be less than 256
            var ipv4 = value.match(/:?(?:\d{1,3}\.){3}\d{1,3}/i);
            if(!ipv4) {
                return false;
            ipv4 = ipv4[0].replace(/^:/, '');
            var pieces = ipv4.split('.');
            if (pieces.length != 4) {
                return false;
            var regExp = /^[\-\+]?\d*$/;
            for (var i=0; i< pieces.length; i++) {
                if (pieces[i] == '') {
                    return false;
                var piece = parseInt(pieces[i], 10);
                if (isNaN(piece) || piece > 255 || !regExp.test(pieces[i]) || pieces[i].length>3 || /^0{2,3}$/.test(pieces[i])) {
                    return false;
        if (ret && value.indexOf("/") != -1) {
            // if prefix-length is specified must be in [1-128]
            var prefLen = value.match(/\/\d{1,3}$/);
            if (!prefLen) return false;
            var prefLenVal = parseInt(prefLen[0].replace(/^\//,''), 10);
            if (isNaN(prefLenVal) || prefLenVal > 128 || prefLenVal < 1) {
                return false;
        return ret;
    Spry.Widget.ValidationTextField.onloadDidFire = false;
    Spry.Widget.ValidationTextField.loadQueue = [];
    Spry.Widget.ValidationTextField.prototype.isBrowserSupported = function()
        return Spry.is.ie && Spry.is.v >= 5 && Spry.is.windows
            ||
        Spry.is.mozilla && Spry.is.v >= 1.4
            ||
        Spry.is.safari
            ||
        Spry.is.opera && Spry.is.v >= 9;
    Spry.Widget.ValidationTextField.prototype.init = function(element, options)
        this.element = this.getElement(element);
        this.errors = 0;
        this.flags = {locked: false, restoreSelection: true};
        this.options = {};
        this.event_handlers = [];
        this.validClass = "textfieldValidState";
        this.focusClass = "textfieldFocusState";
        this.requiredClass = "textfieldRequiredState";
        this.hintClass = "textfieldHintState";
        this.invalidFormatClass = "textfieldInvalidFormatState";
        this.invalidRangeMinClass = "textfieldMinValueState";
        this.invalidRangeMaxClass = "textfieldMaxValueState";
        this.invalidCharsMinClass = "textfieldMinCharsState";
        this.invalidCharsMaxClass = "textfieldMaxCharsState";
        this.textfieldFlashTextClass = "textfieldFlashText";
        if (Spry.is.safari) {
            this.flags.lastKeyPressedTimeStamp = 0;
        switch (this.type) {
            case 'phone_number':options.format = Spry.Widget.Utils.firstValid(options.format, 'phone_us');break;
            case 'currency':options.format = Spry.Widget.Utils.firstValid(options.format, 'comma_dot');break;
            case 'zip_code':options.format = Spry.Widget.Utils.firstValid(options.format, 'zip_us5');break;
            case 'date':
                options.format = Spry.Widget.Utils.firstValid(options.format, 'mm/dd/yy');
                break;
            case 'time':
                options.format = Spry.Widget.Utils.firstValid(options.format, 'HH:mm');
                options.pattern = options.format.replace(/[hms]/gi, "0").replace(/TT/gi, 'AM').replace(/T/gi, 'A');
                break;
            case 'ip':
                options.format = Spry.Widget.Utils.firstValid(options.format, 'ipv4');
                options.characterMasking = Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].characterMaskingFormats[ options.format];
                break;
        //retrieve the validation type descriptor to be used with this instance (base on type and format)
        //widgets may have different validations depending on format (like zip_code with formats)
        var validationDescriptor = {};
        if (options.format && Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].formats) {
            if (Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].formats[options.format] ) {
                Spry.Widget.Utils.setOptions(validationDescriptor, Spry.Widget.ValidationTextField.ValidationDescriptors[this.type].formats[options.format]) ;
        } else {
            Spry.Widget.Utils.setOptions(validationDescriptor, Spry.Widget.ValidationTextField.ValidationDescriptors[this.type]);
        //set default values for some parameters which were not aspecified
        options.useCharacterMasking = Spry.Widget.Utils.firstValid(options.useCharacterMasking, false);
        options.hint = Spry.Widget.Utils.firstValid(options.hint, '');
        options.isRequired = Spry.Widget.Utils.firstValid(options.isRequired, true);
        options.additionalError = Spry.Widget.Utils.firstValid(options.additionalError, false);
        if (options.additionalError)
            options.additionalError = this.getElement(options.additionalError);
        //set widget validation parameters
        //get values from validation type descriptor
        //use the user specified values, if defined
        options.characterMasking = Spry.Widget.Utils.firstValid(options.characterMasking, validationDescriptor.characterMasking);
        options.regExpFilter = Spry.Widget.Utils.firstValid(options.regExpFilter, validationDescriptor.regExpFilter);
        options.pattern = Spry.Widget.Utils.firstValid(options.pattern, validationDescriptor.pattern);
        options.validation = Spry.Widget.Utils.firstValid(options.validation, validationDescriptor.validation);
        if (typeof options.validation == 'string') {
            options.validation = eval(options.validation);
        options.minValue = Spry.Widget.Utils.firstValid(options.minValue, validationDescriptor.minValue);
        options.maxValue = Spry.Widget.Utils.firstValid(options.maxValue, validationDescriptor.maxValue);
        options.minChars = Spry.Widget.Utils.firstValid(options.minChars, validationDescriptor.minChars);
        options.maxChars = Spry.Widget.Utils.firstValid(options.maxChars, validationDescriptor.maxChars);
        Spry.Widget.Utils.setOptions(this, options);
        Spry.Widget.Utils.setOptions(this.options, options);
    Spry.Widget.ValidationTextField.prototype.destroy = function() {
        if (this.event_handlers)
            for (var i=0; i<this.event_handlers.length; i++) {
                Spry.Widget.Utils.removeEventListener(this.event_handlers[i][0], this.event_handlers[i][1], this.event_handlers[i][2], false);
        try { delete this.element; } catch(err) {}
        try { delete this.input; } catch(err) {}
        try { delete this.form; } catch(err) {}
        try { delete this.event_handlers; } catch(err) {}
        try { this.selection.destroy(); } catch(err) {}
        try { delete this.selection; } catch(err) {}
        var q = Spry.Widget.Form.onSubmitWidgetQueue;
        var qlen = q.length;
        for (var i = 0; i < qlen; i++) {
            if (q[i] == this) {
                q.splice(i, 1);
                break;
    Spry.Widget.ValidationTextField.prototype.attachBehaviors = function()
        if (this.element) {
            if (this.element.nodeName == "INPUT") {
                this.input = this.element;
            } else {
                this.input = Spry.Widget.Utils.getFirstChildWithNodeNameAtAnyLevel(this.element, "INPUT");
        if (this.input) {
            if (this.maxChars) {
                this.input.removeAttribute("maxLength");
            this.putHint();
            this.compilePattern();
            if (this.type == 'date') {
                this.compileDatePattern();
            this.input.setAttribute("AutoComplete", "off");
            this.selection = new Spry.Widget.SelectionDescriptor(this.input);
            this.oldValue = this.input.value;
            var self = this;
            this.event_handlers = [];
            this.event_handlers.push([this.input, "keydown", function(e) { if (self.isDisabled()) return true; return self.onKeyDown(e || event); }]);
            this.event_handlers.push([this.input, "keypress", function(e) { if (self.isDisabled()) return true; return self.onKeyPress(e || event); }]);
            if (Spry.is.opera) {
                this.event_handlers.push([this.input, "keyup", function(e) { if (self.isDisabled()) return true; return self.onKeyUp(e || event); }]);
            this.event_handlers.push([this.input, "focus", function(e) { if (self.isDisabled()) return true; return self.onFocus(e || event); }]);
            this.event_handlers.push([this.input, "blur", function(e) { if (self.isDisabled()) return true; return self.onBlur(e || event); }]);
            this.event_handlers.push([this.input, "mousedown", function(e) { if (self.isDisabled()) return true; return self.onMouseDown(e || event); }]);
            var changeEvent =
                Spry.is.mozilla || Spry.is.opera || Spry.is.safari?"input":
                Spry.is.ie?"propertychange":
                "change";
            this.event_handlers.push([this.input, changeEvent, function(e) { if (self.isDisabled()) return true; return self.onChange(e || event); }]);
            if (Spry.is.mozilla || Spry.is.safari) {
                //oninput event on mozilla does not fire ondragdrop
                this.event_handlers.push([this.input, "dragdrop", function(e) { if (self.isDisabled()) return true; self.removeHint();return self.onChange(e || event); }]);
            } else if (Spry.is.ie){
                //ondrop&onpropertychange crash on IE
                this.event_handlers.push([this.input, "drop", function(e) { if (self.isDisabled()) return true; return self.onDrop(e || event); }]);
            for (var i=0; i<this.event_handlers.length; i++) {
                Spry.Widget.Utils.addEventListener(this.event_handlers[i][0], this.event_handlers[i][1], this.event_handlers[i][2], false);
            // submit
            this.form = Spry.Widget.Utils.getFirstParentWithNodeName(this.input, "FORM");
            if (this.form) {
                // if no "onSubmit" handler has been attached to the current form, attach one
                if (!this.form.attachedSubmitHandler && !this.form.onsubmit) {
                    this.form.onsubmit = function(e) { e = e || event; return Spry.Widget.Form.onSubmit(e, e.srcElement || e.currentTarget) };
                    this.form.attachedSubmitHandler = true;                
                if (!this.form.attachedResetHandler) {
                    Spry.Widget.Utils.addEventListener(this.form, "reset", function(e) { e = e || event; return Spry.Widget.Form.onReset(e, e.srcElement || e.currentTarget) }, false);
                    this.form.attachedResetHandler = true;                
                // add the currrent widget to the "onSubmit" check queue;
                Spry.Widget.Form.onSubmitWidgetQueue.push(this);
    Spry.Widget.ValidationTextField.prototype.isDisabled = function() {
        return this.input && (this.input.disabled || this.input.readOnly) || !this.input;
    Spry.Widget.ValidationTextField.prototype.getElement = function(ele)
        if (ele && typeof ele == "string")
            return document.getElementById(ele);
        return ele;
    Spry.Widget.ValidationTextField.addLoadListener = function(handler)
        if (typeof window.addEventListener != 'undefined')
            window.addEventListener('load', handler, false);
        else if (typeof document.addEventListener != 'undefined')
            document.addEventListener('load', handler, false);
        else if (typeof window.attachEvent != 'undefined')
            window.attachEvent('onload', handler);
    Spry.Widget.ValidationTextField.processLoadQueue = function(handler)
        Spry.Widget.ValidationTextField.onloadDidFire = true;
        var q = Spry.Widget.ValidationTextField.loadQueue;
        var qlen = q.length;
        for (var i = 0; i < qlen; i++)
            q[i].attachBehaviors();
    Spry.Widget.ValidationTextField.addLoadListener(Spry.Widget.ValidationTextField.processLoa dQueue);
    Spry.Widget.ValidationTextField.addLoadListener(function(){
        Spry.Widget.Utils.addEventListener(window, "unload", Spry.Widget.Form.destroyAll, false);
    Spry.Widget.ValidationTextField.prototype.setValue = function(newValue) {
        this.flags.locked = true;
        this.input.value = newValue;
        this.flags.locked = false;
        this.oldValue = newValue;
        if (!Spry.is.ie) {
            this.onChange();
    * save the state of the input (selection and value) so we can revert to it
    * should call this just before modifying the input value
    Spry.Widget.ValidationTextField.prototype.saveState = function()
        this.oldValue = this.input.value;
        this.selection.update();
    Spry.Widget.ValidationTextField.prototype.revertState = function(revertValue)
        if (revertValue != this.input.value) {
            this.input.readOnly = true;
            this.input.value = revertValue;
            this.input.readOnly = false;
            if (Spry.is.safari && this.flags.active) {
                this.input.focus();
      if (this.flags.restoreSelection) {
        this.selection.moveTo(this.selection.start, this.selection.end);
        this.redTextFlash();
    Spry.Widget.ValidationTextField.prototype.removeHint = function()
        if (this.flags.hintOn) {
            this.input.value = "";
            this.flags.hintOn = false;
            this.removeClassName(this.element, this.hintClass);
            this.removeClassName(this.additionalError, this.hintClass);
    Spry.Widget.ValidationTextField.prototype.putHint = function()
        if(this.hint && this.input && this.input.type == "text" && this.input.value == "") {
            this.flags.hintOn = true;
            this.input.value = this.hint;
            this.addClassName(this.element, this.hintClass);
            this.addClassName(this.additionalError, this.hintClass);
    Spry.Widget.ValidationTextField.prototype.redTextFlash = function()
        var self = this;
        this.addClassName(this.element, this.textfieldFlashTextClass);
        setTimeout(function() {
            self.removeClassName(self.element, self.textfieldFlashTextClass)
        }, 100);
    Spry.Widget.ValidationTextField.prototype.doValidations = function(testValue, revertValue)
        if (this.isDisabled()) return false;
        if (this.flags.locked) {
            return false;
        if (testValue.length == 0 && !this.isRequired) {
            this.errors = 0;
            return false;
        this.flags.locked = true;
        var mustRevert = false;
        var continueValidations = true;
        if (!this.options.isRequired && testValue.length == 0) {
            continueValidations = false;
        var errors = 0;
        var fixedValue = testValue;
        //characterMasking - test if all characters are valid with the characterMasking (keyboard filter)
        if (this.useCharacterMasking && this.characterMasking) {
            for(var i=0; i<testValue.length; i++) {
                if (!this.characterMasking.test(testValue.charAt(i))) {
                    errors = errors | Spry.Widget.ValidationTextField.ERROR_FORMAT;
                    fixedValue = revertValue;
                    mustRevert = true;
                    break;
        //regExpFilter - character mask positioning (additional mask to restrict some characters only in some position)
        if (!mustRevert && this.useCharacterMasking && this.regExpFilter) {
            if (!this.regExpFilter.test(fixedValue)) {
                errors = errors | Spry.Widget.ValidationTextField.ERROR_FORMAT;
                mustRevert = true;
        //pattern - testValue matches the pattern so far
        if (!mustRevert && this.pattern) {
            var currentRegExp = this.patternToRegExp(testValue.length);
            if (!currentRegExp.test(testValue)) {
                errors = errors | Spry.Widget.ValidationTextField.ERROR_FORMAT;
                mustRevert = true;
            } else if (this.patternLength != testValue.length) {
                //testValue matches pattern so far, but it's not ok if it does not have the proper length
                //do not revert, but should show the error
                errors = errors | Spry.Widget.ValidationTextField.ERROR_FORMAT;
        if (fixedValue == '') {
            errors = errors | Spry.Widget.ValidationTextField.ERROR_REQUIRED;
        if (!mustRevert && this.pattern && this.useCharacterMasking) {
            var n = this.getAutoComplete(testValue.length);
            if (n) {
                fixedValue += n;
        if(!mustRevert && this.minChars !== null  && continueValidations) {
            if (testValue.length < this.minChars) {
                errors = errors | Spry.Widget.ValidationTextField.ERROR_CHARS_MIN;
                continueValidations = false;
        if(!mustRevert && this.maxChars !== null && continueValidations) {
            if (testValue.length > this.maxChars) {
                errors = errors | Spry.Widget.ValidationTextField.ERROR_CHARS_MAX;
                continueValidations = false;
        //validation - testValue passes widget validation function
        if (!mustRevert && this.validation && continueValidations) {
            var value = this.validation(fixedValue, this.options);
            if (false === value) {
                errors = errors | Spry.Widget.ValidationTextField.ERROR_FORMAT;
                continueValidations = false;
            } else {
                this.typedValue = value;
        if(!mustRevert && this.validation && this.minValue !== null && continueValidations) {
            var minValue = this.validation(this.minValue.toString(), this.options);
            if (minValue !== false) {
                if (this.typedValue < minValue) {
                    errors = errors | Spry.Widget.ValidationTextField.ERROR_RANGE_MIN;
                    continueValidations = false;
        if(!mustRevert && this.validation && this.maxValue !== null && continueValidations) {
            var maxValue = this.validation(this.maxValue.toString(), this.options);
            if (maxValue !== false) {
                if( this.typedValue > maxValue) {
                    errors = errors | Spry.Widget.ValidationTextField.ERROR_RANGE_MAX;
                    continueValidations = false;
        //an invalid value was tested; must make sure it does not get inside the input
        if (this.useCharacterMasking && mustRevert) {
            this.revertState(revertValue);
        this.errors = errors;
        this.fixedValue = fixedValue;
        this.flags.locked = false;
        return mustRevert;
    Spry.Widget.ValidationTextField.prototype.onChange = function(e)
        if (Spry.is.opera && this.flags.operaRevertOnKeyUp) {
            return true;
        if (Spry.is.ie && e && e.propertyName != 'value') {
            return true;

  • My swf is not showing up in my index page

    I just switched to a VPS and my index page loads but without
    the .swf. I know the page loads fine/the connection etc. is correct
    but it's a no-go on my swf file, which is the only thing on the
    page.
    Take a look-see, www.monkeypunk.com. I called my host
    (SmartLogic) and they don't know what the problem is, apparently
    I've loaded everything properly. When I do a test in Dreamweaver,
    the swf shows up.
    Has anyone else run into this problem? Thanks.

    monkeypunkninjaboy wrote:
    > I just switched to a VPS and my index page loads but
    without the .swf. I know
    > the page loads fine/the connection etc. is correct but
    it's a no-go on my swf
    > file, which is the only thing on the page.
    >
    > Take a look-see, www.monkeypunk.com. I called my host
    (SmartLogic) and they
    > don't know what the problem is, apparently I've loaded
    everything properly.
    > When I do a test in Dreamweaver, the swf shows up.
    >
    > Has anyone else run into this problem? Thanks.
    >
    I believe it's the JS fle reference path that cause this
    problem.
    Most likely it's incorrect and w/o that file the browser
    won't load flash
    correctly.
    You are on the root of your server and you refer to that file
    using:
    ../../Scripts/AC_RunActiveContent.js
    Also, suggest you don't use - in the file name. - stands
    literally for MINUS and
    some scripts will try to perform that operation on your file
    string.
    If you want to separate names, use underscore instead. This
    has nothing to do
    with the current problem, just a side note.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How can I have a default servlet and an index.html?

    Hi,
    I writing a small webapp to test/understand the 2.2 Servlet Spec. I am deploying this as a WAR to Orion, Tomcat and Silverstream.
    The app's name is: "myapp"
    My application has an index.html, which is listed as the sole welcome-file in the welcome-file-list element in the app's web.xml.
    The interesting thing is that, after adding a default Servlet (<url-pattern>/</url-pattern>), I can no longer access the app's index.html either implicitly or explicitly:
    1. Implicit:
    - http://localhost/myapp
    - http://localhost/myapp/
    2. Explicit:
    - http://localhost/myapp/index.html
    - http://localhost/myapp/index.html/
    All of these invoke the Default Servlet in all 3 app servers.
    Question: How can I have both a default Servlet and an index page?
    Thanks in advance.
    Miles

    you can define it in the web.xml file
    look at the dtd, element "welcome-file-list"

  • Template versus index page

    I am designing a website with dreamweaver making a template.  The template for the home page is pretty much done.  Then I discovered that I not only need to make a template for the home page but a template for the pages I am connecting to the home page.  (I had thought that after I made the home page template, I would save that as my index page?)  My question is:  Do I need both?  When I upload it to my webhost, do I upload the template with the content, and the index page, or do I keep the template stored on my computer and then upload the site as just an index page plus the content pages picture files etc.?

    The actual Dreamweaver Template (.dwt file) never gets uploaded, unless you want to share it with someone for some reason, like debugging.
    .DWT files are only used by DW, not the server. Once you create a .dwt and have it saved in the Templates folder of your Defined Site, you will need to create Child Pages based off of it.
    To do that, in DWCC...
    1. Click File > New
    2. Click Site Templates
    3. Click the site where the template you want to use is located
    4. Click the name of the template you want to use
    5. Click Create
    6. Make your edits to the Editable Regions of the newly created Child Page
    7. Save the Child Page as whatever you like (index.html is a good starting point)
    From there on out, if you make a change to the actual .dwt file, those changes will propagate to all of the Child Pages created in the above manner in your Defined Site.

  • IWeb '09 and creating an "Index" page for two separate sides of my website

    I'm redesigning my website with iWeb '09 seeing that I've recently switched to Mac from being a life-long PC/Windows user. I'm not too web programming savvy so iWeb fits my needs as a very good program that redesigns my site very nicely (and quite inexpensively, as well).
    My current incarnation of my website (http://www.jeffreykern.com) was designed by a professional web designer on Dreamweaver for PC a couple of years ago. Some time ago when I was trying to update my PC with XP SP 3 (bad idea as it turned out), my connection to my web hosting service got completely fouled up and I lost the ability to update the site and haven't updated my site since. Knowing that I was going to be switching to Mac (with my new Mac Pro) I never had the desire, or energy, to patch things up to update my site with my PC. Plus, I was in need of a redesign so I eventually got my site ready to go with iWeb 09. That's where I stand right now...
    So, as you can see on my current site I have a main index page that splits up into the two sides of my life: the triathlete side and the writer side. I've already redesigned both sides of my site with iWeb, I'm ready to update it thru my web hosting via FTP and Transmit 3, but I cannot find how to create a main "Index" page on iWeb that will let me branch off into two different directions. By having that "Index" page intact I will be able to keep my domain of jeffreykern.com as it currently stands. I don't mind having to get two different domains for each of my two sides of my site but would like to avoid that extra step -- if, at all, possible.
    Thanks in advance for your help,
    Jeff

    Building three websites on three separate domain files would be my choice.
    Its important to realize that you cannot have a page called "index" using iWeb because the associated index.html file will conflict with the one that iWeb creates.
    As has been suggested, the first site would be one page. The site name would be jeffreykern.
    This site will publish as jeffreykern_files and an index.html file. Inside this folder is another index.html file. This is the one your domain name will be directed at if you don't need an RSS feed.
    If your server allows it, create a root folder on it called "jeffreykern" and upload the contents of the local folder to this and ignore the separate index.html file. Note that I said contents and not the folder itself.
    A lot of servers require that you upload to a pre existing folder. In this case you will have to upload the index.html file and the jeffreykern _files folder.
    The two other sites are named and published as writer and triathlete. The external index files of these two sites are renamed writer.html and triathlete.html.
    These two files and their corresponding folders are uploaded to your root folder on the server after adding tags and optimizing.......
    http://www.iwebformusicians.com/SearchEngines/SEO.html
    Now you have a main (one page) site with two sub sites.
    The domain name http://www.jeffreykern.com/ is directed at the index.html file so that when this is entered into the browser, the main page will appear.
    The links to the two main sections, whether they be text and/or image, are created and selected as external hyperlinks.
    http://www.jeffreykern.com/triathlete/
    http://www.jeffreykern.com/writer/
    Clicking these links will open the first page of their respective sites.
    If you do the sensible thing and trash the iWeb default navigation to replace it with a custom one, you can include external hyperlinks to the landing page and the other site in this.
    The website - iWeb for Musicians - is created like this and is built on 9 separate domain files for ease of updating and publishing. The whole site is tied together with a Main navigation to get to each section which has a Sub navigation to jump around that section.
    For more on navigation see.....
    http://www.iwebformusicians.com/WebMusic/Navigation.html
    Also refer to Fonts, Colors and Navigation on this page ......
    http://www.iwebformusicians.com/WebMusic/iWebandInternetExplorer.html

  • Html and indexed pages

    I am trying to get ranked in google and only my index pages
    tend to get indexed. I do not understand why my secondary pages, do
    not get indexed for Lake Martin Real Estate searches.
    http://www.yourlakemartin.com
    Site header and search word as follows:
    LAKE MARTIN REAL
    ESTATE

    You can put a file called ".htaccess" in the root of any folder, and the server will use the directives in that file to control how it serves pages to the client.  There is a complete set of commands you can find by Googling "htaccess", probably more than you'd want to read, but among them is the ability to do a server redirect for any page fetch, which would let you redirect all requests for *.html to *.php automatically.  What's nice is that you can send a header along with the redirection that direts the search engines to adjust their indices, called a '301' header.  It specifies that the page requested has been permanently relocated to the new page name.
    On several of my sites I have such redirection being used - the .htaccess file contains markup like this -
    RedirectEngine On
    Redirect 301 /xyzzy.html http://www.example.com/xyzzy.php
    Give Google a try....

  • Redirecting all pages from old URL to index page of new URL

    Hello everybody..
    I have an Apache configuration question, can't work out the procedure in Server Admin.
    Basically I have a website at "oldurl.com". In Server Admin, I have the site set to serve a PHP file which runs a 301 redirect to "newurl.com". Works nicely.
    Trouble is, if somebody requests "oldurl.com/somepage", the 301 redirect does not function.
    I need all pages on "oldurl.com" to forward to the homepage of "newurl.com".
    I suspect I need to type something into the "URL Aliases and Redirects" pane in Server admin, and some sort of wildcard, but I'm stumped. I have read about fiddling with the .htaccess file, but surely this is not necessary?
    Hope you can help. Thank you!

    To give a more detailed (and just possibly relevant) example of what koncept's talking about, suppose you wanted to redirect browsers from any page on the old domain to a corresponding page on the new domain (e.g. http://oldurl.com/this/that/theother.html would redirect to http://newurl.com/this/that/theother.html, rather than just http://newurl.com/). You'd make a rule in the oldurl.com site like this:
    Type: RedirectMatch
    Pattern: (.*)$
    Path: http://newurl.com$1
    The .* matches zero or more anythings, the $ matches the end of the url (to make sure we get the whole thing, not just part of it), and the parentheses capture the match so we can use it in the redirect path as $1. Note that the pattern is matched against the path part of the original url (i.e. "/this/that/theother.html" in the example I gave earlier), so we can just tack it onto the new domain name and we're set.

  • Have published iweb site for five years with no problems and just opened a new site and get - 404: Page not found  This error is generated when there was no web page with the name you specified at the web site.-is the problem with iweb or with hosting?  T

    I am sorry if thie is republished-My first time doing this and I am not sure what goes where and where to hear feedback.
    Have published iweb site for five years with no problems and just opened a new site and get -
    404: Page not found 
    This error is generated when there was no web page with the name you specified at the web site.-
    Troubleshooting suggestions:
    Ensure the page you are linking to exists in the correct folder.
    Check your file name for case sensitivity . Index.htm is not the same as index.htm!
    Temporarily disable any rewrite rules by renaming your .htaccess file if it exists
    is the problem with
    iweb or with hosting?
    One Apple tech started to fix Iweb and had to end session and the next said problem with hosting at Network Solutions as it published
    to local folder. NWS has checked sttting a few times-
    Any help would be extremely appreciated as trying to fix this for about five weeks
    Thanks VG
    <Email Edited by Host>

    It's a really bad idea to post your email address - it's an invitation to spam - and I've asked the Hosts to remove it. (Even though I've now noticed you mis-spelled it! - anyway, never post your address in a forum.)
    You have a site here: http://virginiagordon.com/www.virginiagordon.com/WELCOME.html
    If that's not the page you are having trouble with, what is that page's URL?

  • Making an entrance page and an index (home) page query?

    Hi All,
    I've not done anything this way before but for a uni web design and development assignment, I've to firstly design a website with all the theory and how it will all come together.
    Therefore, I'm wanting mine to be a little different from the generic kind and whilst I'm basing my subject matter on Tigers and the several species of, I'm creating an entrance page in fireworks that is the following;
    I'm planning on sectioning up and placing hotspots around the interior of the tiger body, this will enable viewers to select and go to set pages like "about" "tiger zone" "contact" and so on.
    However, I still need a traditional-ish homepage but I'm unsure how to make it that whilst people come in via the entrance page ( as above and the main url) whenever they've left this page to go in to the main homepage, they don't return via any of the main sites navigation menu / links back to this entrance page, is this possible in anyway?
    I'm trying to get my own head around this and I have spent a number of hours researching this issue but I cannot find any resource that is anything like what I'm needing to do.
    Thanks as always people.
    Regards,

    Yes, 2nd landing page will be the 'traditional' homepage.
    This case, the tiger page will have to be 'index.php' so it'll load when your site is entered in a browser. Why PHP - we'll get to that in a bit.
    Let us use, lets say a cookie to see if the user has already been on your index.php (which is your tiger page). If they already have, they will be taken to index2.html (the 2nd homepage - which doesn't have to be php as we aren't using any cookies/ sessions here).
    Something like this should work:
    <?php
    // please note there is a dot prefixed in '.yourdomain.com':
    setcookie('homepage', 1, time() + 365*24*60*60, '/', '.yourdomain.com');
    if(!empty($_COOKIE['homepage']))
       header('Location: http://yourdomain.com/another_page.html');
       exit;
    // you could add more PHP code (if you require), but ensure this patch of code is right at the top of your tiger index page
    ?>
    This should be placed at the very top of your tiger index page which is your initial homepage when users enter your site.
    This is how it works:
    homepage - the defined name for this cookie
    1 - enables the cookie
    time() - expiration value for the cookie. The value suffixed with 'time()' is for 1 year - meaning the cookie will remain active for 1 year. If you want it to exist until the browser is closed, set it 0 like this:
    setcookie('homepage', 1, 0, '/', '.yourdomain.com');
    The / next to time is the areas within your domain that the cookie is available for. / denotes higher most domain path. This is useful if your index.php file (main splash page) is located within the main domain root itself. If not, if it is located somewhere like yourdomain.com/tigerhome, set that to this:
    setcookie('homepage', 1, time() + 365*24*60*60, '/tigerhome/', '.yourdomain.com');
    Please notice the trailing and prefix slashes for the folder value
    yourdomain.com - is the main value of your domain itself. Please note the prefixed dot [.] before the yourdomain.com.
    How the header works:
       header('Location: http://yourdomain.com/another_page.html');
    If the cookie called 'homepage' exists, then when the user is trying to load index.php, the header condition is read by the browser first. If it is true, the user is taken to another_page.html. If not, the user is allowed to continue viewing index.php page.
    The reason we have this at the very top is because when the user attempts to load up index.php page, you dont want the content to be shown before redirect happens. Hence, the header condition along dependant on the cookie is first read by the browser.
    If you want custom time setting - maybe 1 day, set it to this:
    setcookie('homepage', 1, time() + 1*24*60*60, '/', '.yourdomain.com');
    5 hours, this:
    setcookie('homepage', 1, time() + 1*5*60*60, '/', '.yourdomain.com');
    And so on...
    Note: The cookie will expire if the user clears browser cookies manually!
    But this is the basic way of getting a cookie set for getting what you want done.
    Also, I've set up a test page on my domain for you - expires in 1 year from first visit. Loads on index.php and redirects to test2.html if the cookie is already set. Try it out for yourself here.
    Trust this helps.
    -ST

  • IWEB not generating an index page

    Hi,
    I've screwed something up on my site, so i had to erase the files etc in public_html now when i tried to republish the site there is no index page published what am i doing wrong?
    There is no index page saved on a local folder publish either.
    thanks
    John

    Move a page to the top of the list.
    iWeb will create a new index.html file when published.
    Check it.
    Then move the page back to its original place.
    Publish again and iWeb will create a new index.html file.
    Check it.
    If all this fails, create an index.html file yourself. Copy/paste the code below in a plaintext file and save it as index.html.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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></title>
    <meta http-equiv="refresh" content="0;url= Enter/Enter.html" />
    </head>
    <body></body>
    </html>
    Where it say Enter/Enter.html use your own Site- and filename.

  • Htaccess 404 and 301 redirect

    I have a muse website hosted on windows azure.
    I have created a .htaccess file and added o the root.
    The webpage is still not redirecting to the 404 error page or my 301 redirect that i have set

    Hi Kurian,
    You can Go to Server Settings>>Settings>> Missing Template Handler and setup the same.
    To use the missing template handler with IIS, the Custom Error page of your website must be configured to use the page. For this example, we'll assume a directory name of /errorpages and a file named missingtemplate.cfm. Therefore, the path to the missing template handler will be /errorpages/missingtemplate.cfm.
    The steps below explain how to configure IIS to use the template for the Custom Error page:
    1.          Right-click on the website in the IIS Management Console, then select Properties.
    2.          Select the Custom Errors tab.
    3.          Select the 404 in the HTTP Error column and click Edit Properties...
    4.          Select URL from the Message type dropdown and enter /errors/missingtemplate.cfm in the URL text box.
    5.          Click OK.
    6.          Right-click on the website again and select Properties.
    7.          Select the Home Directory tab and click the Configuration... button.
    8.          Select .cfm from the list and click the Edit button.
    9.          Check the "Check that file exists" checkbox.
    10.          Restart IIS and the ColdFusion Server.
    Regards,
    Anit Kumar

  • My index page is not redirecting. I see index of / with redirect links

    I am using A Small Orange and publishing directly from iWeb to a Small Orange.  How can I resolve this issue?  I am an absolute beginner so please assume I know nothing about creating a website!  Thank you.
    the page is www.ellowynbehring.com

    It looks as if you have not uploaded your site to the root folder on your server?
    What file there did you upload to?  If you upload your whole site folder to your server, then you also need to upload the separate index file that iWeb produces on publishing and this needs to sit outside your site folder to point into the index file that is in the site folder.
    What is probably best to do is to go into iWeb and select publish to a local folder and then your site folder and separate index file will be published to your desktop.  Then download Cyberduck, which is a free and dedicated ftp client that you can use to upload your site to your server.
    Open Cyberduck and connect to your server and you will then be able to see exactly where you are uploading to and what folder on your server you need to upload to.
    Once you can see this, upload your site folder and then upload the separate index file, but it needs to sit outside your site folder pointing in towards it.

Maybe you are looking for

  • I can't update packages after upgrading pacman to 4.0.3

    I know this was already treated broadly about two months ago, but I can't update after upgrading pacman because of continuous problems with certain signatures (at least one). I have already tried this: rm -rf /etc/pacman.d/gnupg pacman -Scc pacman-ke

  • How to handle empty columns

    Hi guys, I have a template like below for each Field1 Field2 Field3 Field4 Field5 Field5 end for each I used a if condition to hide the field when the value is null. The report looks like below Field1 Field2 Field3 NULL NULL Field6 Field7 NULL NULL Q

  • Document Version  management

    Hi , can any body suggest me , how we saved different version of document in document management (Enterprise Portal).where it will saved. Its urgent. please help .. Thanks

  • How to get my old iWeb files working in iweb'08 (version 2.0.4)

    Hi folks! OK, so I have new iMac with iWeb'08. I then copied all website data to the sites folder on the new machine. Now I do not see my old websites in iWeb anymore. I start investigating and now I learnt that I need to copy a domain.sites2 file lo

  • Process steps on releasing activity and importing in consolidation of cms

    Hi All, I have a question on consolidation in nwdi,I have develpment configurations trackname_dev and trackname_con. I imported trackname_dev and checked out(asked for activity ,so created the activity) and modified an ess DC and then checked in to D