RU beehive logo ITEC dept promo banner
ITEC 325
2011fall
ibarland

homelectsexamshws
breeze (snow day)

lect06b-sticky
sticky forms
and, the mechanics of invoking javascript validation

Javascript events for validating client-side


Sticky forms

 - sticky form:
    (a) When you make the form, include 'value=...' in the tags appropriately.
    (b) But to do this, the page that *makes* the form has to be the
         same as the page that *recives* the form!
    (c) Imagine a big if-statement:
             if (this-form-was-submitted) {
                 ...validate and print server-side error message...
                 }
           
             if (form-was-submitted && data-is-valid) {
                 ...handle the accepted form stuff...
                 }
             else {
                 ...print the form...
                 echo "<input type='text' name="lastName" value=??? maxlength=??? />
             }
     (c2) example: lect06c-sticky-form.php
             
     (d) <input type="hidden" name="i-came-from-the-form" value="true" />
     (e) You can include files:
                require         include       require_once      include_once

homelectsexamshws
breeze (snow day)


©2011, Ian Barland, Radford University
Last modified 2011.Oct.07 (Fri)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme