Tutorial for Spry Form Validation

Adobe's Dreamweaver web design software allows web developers to use Spry Validation Text Field widgets to create forms that display updated information on whether the user's input meets the validation criteria given by the developers. The Spry widget will also display error messages specific to the reason why the input failed to validate, such as an invalid format or an empty, required field. You can edit the Spry CSS file to change the appearance of the error messages and states.

Instructions

    • 1

      Add a link to the Spry JavaScript library and CSS file in the section between the "<head>" tags at the top of the HTML page containing the form:

      <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>

      <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />

    • 2

      Determine which of the Spry form validation states apply to your form inputs. Inputs are in the "initial state" when the page first starts, and transition to the "focus state" when the user clicks or moves to it. Spry also contains states for when the form item does not meet a minimum or maximum number of characters, when it does not contain required data, when the data has an invalid format or if the user does not select a required check box or radio button.

    • 3

      Enclose the form input within "<span>" tags that apply the Spry settings to that input:

      <span id="sprytextfield1"> ...... </span>

    • 4

      Add a span tag set directly after the line on the HMTL form input to specify which type of Spry error message state. To require some input for a text field, add "<span class="textfieldRequiredMsg">A value is required.</span>." You can change the text between the span tags to any text that you want. An example for a required check box is "<span class="checkboxRequiredMsg">Check at least one box.</span>."

    • 5

      Initialize the Spry validation widget after the closing HTML form tag by adding the JavaScript call to the widget fields, replacing "sprytextfield1" with the name used in the initial span tags that enclosed the entire form input:

      <script type="text/javascript">

      var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");

      </script>

Related Searches:

References

Comments

You May Also Like

  • How to Validate a Text Field With Dreamweaver Spry Form Widgets

    Dreamweaver CS3 comes with some Spry validation widgets for forms. In this article you will learn how to validate a text field...

  • Dreamweaver PHP Update Form Tutorial

    Dreamweaver is a Web development tool from Adobe that allows you to build graphical websites without having to hand-code them in a...

  • How to Validate a Text Area With Dreamweaver Spry Form Widgets

    Dreamweaver CS3 comes with some Spry validation widgets for forms. In this article you will learn how to validate a text area...

  • What Is Spry Validation?

    As we rely more on the Internet for transactions and information exchange, we experience a heightened need for protection. Spry validation serves...

  • How to Check for a Valid Driver's License

    An invalid drivers license is not an uncommon thing, according to the Florida Department of Motor Vehicles. While there are those who...

  • Who Uses Spry?

    Spry was an American brand of vegetable shortening owned by Lever Brothers (now Unilever) and most popular between the 1930s and '50s....

  • How to Set the Form Element Values With JavaScript

    Many tools enable you to create an interactive website. JavaScript is a client-side scripting language you can use to produce dynamic data...

  • HTML Form Validation Tutorial

    Hypertext markup language (HTML) is used to create static Web pages. Many HTML pages consist of forms, such as user logins that...

  • How to Validate in Visual Basic

    One of the most frustrating areas in writing code in any language, including Visual Basic, involves ensuring that when users input information...

  • Dreamweaver 2004 Tutorial

    Adobe Dreamweaver MX 2004 is a web development and design software that enables web designers to manage, edit, create and upload pages...

  • How to Use Spry

    Spry is a feature added to Adobe Dreamweaver CS3. It simplifies inserting interactive elements on a Web page without using other programs....

  • Spry Widget Tips

    Edit the Widget style in a particular Widget in one of three ways. Use the relevant CSS file from the "SpryAssets" folder...

  • How to Display Images in Spry

    Spry is an Adobe Dreamweaver framework that is used to incorporate XML, JSON or HTML data into pages using HTML, CSS and...

  • How to Make Your Own Pepper Spray

    An effective form of pepper spray can be made at home for a fraction of the cost of purchasing capsicum spray from...

  • Dreamweaver Spry Tutorial

    With Dreamweaver's Spry tabbed panel widget, you can condense websites considerably. For example, a 10-page website can be condensed to just one...

  • JavaScript Form Validation Email Tutorial

    Validating a form from a website is crucial to making sure that you get the proper information. There are several ways to...

  • What Is a Spry Dataset?

    A Spry Data Set lets you set up a website supplying interactive data to the user based on selections made while viewing...

  • Drop Down Spry Menu Tutorial

    The Adobe Dreamweaver application allows you to create you own website using simple tool options. You can also manually enter HTML and...

  • How to Use Spry Effects in Dreamweaver CS3

    Spry Effects were added to the available Dreamweaver behaviors in the CS3 version. They create visual effects such as highlighting particular parts...

  • How to Left, Right, Center Align With CSS

    Instead of using HTML alignment attributes with the HTML tags that markup text, the best practice for web designers is to move...

Related Ads

Featured