Docstoc

Forms

Document Sample
Forms Powered By Docstoc
					                                          Forms
|Contents
|Intro.
|Examples
|Validity
|Tasks

                                        Contents

                                Introduction.

                                Examples:

                                       Fill in the Blank.
                                       Select an Option.
                                       Fahrenheit to
                                        Centigrade.
                                     Style Changes.
                                     Password.
                                     Section conclusion.
                                Validity:

                                         Action Attribute for
                                          everyone.
                                         Further advice for
                                          XHTML.
                                Tasks.

            Start >


                                     Introduction

                        During this lesson and our next
                        lesson, we shall study some of the
                        fundamentals for data processing
                        and data verification through
                        javascript ~ particularly of data
                        entered into forms.

                        This week's lesson in meant to
                        stimulate the imagination by
                        presenting some examples.

                        During our next lesson, we shall
                        analyze these examples to learn
                        about the nuts and bolts of it all.

            Examples, Next
                              Examples

                             Fill in the Blank (next
                              page).

                             Select an Option.

                             Fahrenheit to
                              Centigrade.

                             Style Changes.

                             Password.

                             Section conclusion.

Fill in the Blank, Next >


                              Examples

              Fill in the Blank

Jack be Nibble.
Jack be Quick.

Jack jumped over the                     .

                                 Reset



Next >

                  What kind of a silly answer was
                              that?

                             Need a Hint?

              Select an Option

              Jack be Nibble.
              Jack be Quick.
              Jack Jumped over the . . .
                            Examples

                       Let's get serious.



            Fahrenheit to Centigrade

            Change the degrees of Fahrenheit
            in the top box. Press to calculate,
            and see the equivalent in degrees
            of Centigrade in the lower box.

           Degrees Fahrenheit:       50




                    Reset




Next >



                            Examples

            Style Changes

         Background Color                 Font Style
               Ivory                        Sans-Serif
               Pale Yellow                  Cursive
               Light Blue                   Monospace
               White                        Serif

            These changes occur through
            inline scripts that should work
            across browsers to graphical
            versions 4. We shall analyze the
            scripts in our next lesson. Today,
            just play with the changes, and
            notice that the changes are
            occurring by radio buttons in a
            form.


Next >
                     Welcome
    YSU Expository Writing




Press the boat, and enter the password.


                                                Examples

                               Password

                               In the example, the password was
                               controlled with a prompt, not with
                               a form. The same can be achieved,
                               and rather more nicely, with a
                               form.

                               The prompt script does involve
                               data verification, nevertheless ~
                               yes, the verification of the
                               password. So, you can practice
                               with it also if you wish to.

                               Did the password appear to be
                               insecure in the example, because
                               the script is simple? Anyone with
                               some fundamental knowledge of
                               javascript might be able to open
                               the page-source, locate the script,
                               and find the password ~ or would
                               it be so easy to find? Are you
                               curious to see?

                                         Return to the password
                                          example.

                                         Open its page-source.

                                         Try to find the simple little
                                          script that contains the
                                          password and its url.

                               (The script tags that you may see
                               in the head of the document do not
                               lead to the password script. The
                               password script is in the body of
              the document. The body of the
              document has been encrypted. So,
              the script is encrypted there-in. An
              intermediate to advance
              knowledge of scripting would be
              needed for someone to decrypt the
              body, to locate the script, and to
              find the password and its url. Yes,
              a javascript that as simple as that
              one can become difficult to find
              and to crack.)

Next >

                             Examples

              Section Conclusion

                      In our next lesson, we shall
                       analyze the scripts from this
                       lesson's examples.

                      These examples have been
                       meant just to stimulate the
                       imagination about some of
                       the many ways that scripts
                       may work with forms.

                      The scripts can as playful or
                       as serious as we may wish
                       them to be for interaction
                       with a visitor. When they
                       are serious, the scripts
                       process data and/or verify
                       data for the visitor.

                      Furthermore, a form haa a
                       capacity to dispatch the
                       data through its action
                       attribute, as we shall see
                       next.

Validity, Next >




                              Validity
            Action Attribute for
             everyone.

            Further advice for
             XHTML.



Action Attribute

The action attribute in the opening
<form> tag has the capacity to
dispatch the data that are collected
in a form.

      You must include the action
       attribute in the opening
       <form> tag for validity in
       HTML (and XHTML).

Here are some possibilities.



Leave it blank.

action=""

<form action="">

      Info. about this option.



Use the mailto url in the action
attribute

action="mailto:me@myAddress.co
m"

<form
action="mailto:me@myAddress.co
m" enctype="text/plain"
method="post">

      Info. about this option.



Use an url to link to a server-
side script
         <form
         action="http://www.mySite.com/
         cgi-bin/myScript.asp"
         method="post">

               Info. about this option.



Next >

                       Validity

         Further Advice for XHTML

         You may skip this page and jump
         to the tasks now if you are not
         using XHTML.

                Use XHTML-transitional
                with the name attribute

               Some javascript examples
                rely on the name attributes
                in the elements of a form.

               The name attribute has
                been deprecated from
                XHTML version 1.0 strict
                and all subsequent versions
                of XHTML.

               Therefore, you should use
                XHTML-transitional with
                the name attribute.

                Be careful with the nesting
                of forms

               This advice depends on the
                version of XHTML that you
                are using.

               In XHTML version 1.1, a
                form sometimes cannot be
                nested inside div tags. The
                div must be nested inside
                the form, like this for
                instance:

                <form><div style="text-
                align:center;"> . . .
                </div></form>
                      Remember: this will depend
                       on the version of XHTML
                       that you are using. Just
                       remain aware, so that you
                       may adjust the nesting if
                       ever you happen to receive
                       an error message through
                       the validator telling you that
                       a form is misplaced.

Tasks, Next >

                1. Start our 4th Assignment.

                       Timing

                      Practice with the
                       construction of forms
                       without scripts this week.
                       Seek validation for the
                       HTML (or XHTML) and the
                       CSS in your construction of
                       your forms this week.

                      Next week, you can add
                       javascript into your validly
                       constructed forms.



                2. Begin to Study about
                JavaScripts for Forms.

                      If ~ big IF ~ you find that
                       you can construct forms to
                       validation standards rather
                       quickly this week, then
                       embark into a study about
                       javascripts for forms.

                      Javascript textbooks and
                       on-line tutorials usually (in
                       my experience) contain
                       clearly marked sections
                       about forms. So, you should
                       find the material readily.

				
DOCUMENT INFO