~ubuntu-branches/ubuntu/intrepid/libcgi-formbuilder-perl/intrepid

« back to all changes in this revision

Viewing changes to t/1a-test28.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-28 20:29:04 UTC
  • mfrom: (2.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080628202904-81kzjon8e8silx88
Tags: 3.05.01-6
Set urgency=medium as 3.05.01-6 included a FTBFS bugfix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Content-type: text/html
 
2
 
1
3
<html>
2
4
<head>
3
5
<title>TEST</title>
6
8
function validate (form) {
7
9
    var alertstr = '';
8
10
    var invalid  = 0;
 
11
    var invalid_fields = new Array();
9
12
 
10
13
    // fullname: standard text, hidden, password, or textarea box
11
14
    var fullname = form.elements['fullname'].value;
12
15
    if (fullname == null || fullname === "") {
13
16
        alertstr += '- Invalid entry for the "Full Name" field\n';
14
17
        invalid++;
 
18
        invalid_fields.push('fullname');
15
19
    }
16
20
    if (invalid > 0 || alertstr != '') {
17
21
        if (! invalid) invalid = 'The following';   // catch for programmer error
18
22
        alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'
19
23
                +alertstr+'\n'+'Please correct these fields and try again.');
20
 
        // reset counters
21
 
        alertstr = '';
22
 
        invalid  = 0;
23
24
        return false;
24
25
    }
25
26
    return true;  // all checked ok
31
32
<h3>TEST</h3>
32
33
<noscript><span class="fb_invalid">Please enable Javascript or use a newer browser.</span></noscript>
33
34
<p>1 error(s) were encountered with your submission. Please correct the fields <span class="fb_invalid">highlighted</span> below.</p>
34
 
<form action="TEST" method="post" onsubmit="return validate(this);">
35
 
<div>
36
 
<input id="_submitted" name="_submitted" type="hidden" value="1" />
 
35
<form action="TEST" class="fb_form" method="post" onsubmit="return validate(this);">
 
36
<div class="fb_state"><input id="_submitted" name="_submitted" type="hidden" value="1" /></div>
37
37
<table class="fb">
38
38
<tr>
39
39
  <td class="fb_label"><span class="fb_required">Full Name</span></td>
85
85
  <td class="fb_submit" colspan="2"><input class="fb_button" id="_reset" name="_reset" type="reset" value="Showme" /><input class="fb_button" id="_submit" name="_submit" onclick="this.form._submit.value = this.value;" type="submit" value="Update" /><input class="fb_button" id="_submit_2" name="_submit" onclick="this.form._submit.value = this.value;" type="submit" value="Delete" /></td>
86
86
</tr>
87
87
</table>
88
 
</div>
89
88
</form>
90
89
</body>
91
90
</html>