RU beehive logo ITEC dept promo banner
ITEC 325
2012spring
ibarland

homelectsexamshws
D2Lbreeze (snow day)

lect07b-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: lect07b-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
D2Lbreeze (snow day)


©2012, Ian Barland, Radford University
Last modified 2012.Mar.29 (Thu)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme