celerity 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. data/History.txt +4 -0
  2. data/License.txt +621 -0
  3. data/README.txt +58 -0
  4. data/Rakefile +4 -0
  5. data/lib/celerity.rb +47 -0
  6. data/lib/celerity/clickable_element.rb +11 -0
  7. data/lib/celerity/collections.rb +99 -0
  8. data/lib/celerity/container.rb +369 -0
  9. data/lib/celerity/disabled_element.rb +20 -0
  10. data/lib/celerity/element.rb +114 -0
  11. data/lib/celerity/element_collections.rb +67 -0
  12. data/lib/celerity/elements/button.rb +13 -0
  13. data/lib/celerity/elements/file_field.rb +12 -0
  14. data/lib/celerity/elements/form.rb +15 -0
  15. data/lib/celerity/elements/frame.rb +44 -0
  16. data/lib/celerity/elements/image.rb +70 -0
  17. data/lib/celerity/elements/label.rb +10 -0
  18. data/lib/celerity/elements/link.rb +13 -0
  19. data/lib/celerity/elements/radio_check.rb +59 -0
  20. data/lib/celerity/elements/select_list.rb +84 -0
  21. data/lib/celerity/elements/table.rb +94 -0
  22. data/lib/celerity/elements/table_body.rb +38 -0
  23. data/lib/celerity/elements/table_cell.rb +30 -0
  24. data/lib/celerity/elements/table_row.rb +34 -0
  25. data/lib/celerity/elements/text_field.rb +80 -0
  26. data/lib/celerity/exception.rb +48 -0
  27. data/lib/celerity/htmlunit/commons-codec-1.3.jar +0 -0
  28. data/lib/celerity/htmlunit/commons-collections-3.2.jar +0 -0
  29. data/lib/celerity/htmlunit/commons-httpclient-3.1.jar +0 -0
  30. data/lib/celerity/htmlunit/commons-io-1.4.jar +0 -0
  31. data/lib/celerity/htmlunit/commons-lang-2.4.jar +0 -0
  32. data/lib/celerity/htmlunit/commons-logging-1.1.1.jar +0 -0
  33. data/lib/celerity/htmlunit/cssparser-0.9.5.jar +0 -0
  34. data/lib/celerity/htmlunit/htmlunit-2.2-SNAPSHOT.jar +0 -0
  35. data/lib/celerity/htmlunit/js-1.7R1.jar +0 -0
  36. data/lib/celerity/htmlunit/nekohtml-1.9.7.jar +0 -0
  37. data/lib/celerity/htmlunit/sac-1.3.jar +0 -0
  38. data/lib/celerity/htmlunit/xalan-2.7.0.jar +0 -0
  39. data/lib/celerity/htmlunit/xercesImpl-2.8.1.jar +0 -0
  40. data/lib/celerity/htmlunit/xml-apis-1.0.b2.jar +0 -0
  41. data/lib/celerity/ie.rb +126 -0
  42. data/lib/celerity/input_element.rb +29 -0
  43. data/lib/celerity/non_control_elements.rb +50 -0
  44. data/lib/celerity/version.rb +9 -0
  45. data/setup.rb +1585 -0
  46. data/spec/area_spec.rb +79 -0
  47. data/spec/areas_spec.rb +41 -0
  48. data/spec/button_spec.rb +171 -0
  49. data/spec/buttons_spec.rb +40 -0
  50. data/spec/checkbox_spec.rb +259 -0
  51. data/spec/checkboxes_spec.rb +39 -0
  52. data/spec/div_spec.rb +174 -0
  53. data/spec/divs_spec.rb +40 -0
  54. data/spec/element_spec.rb +29 -0
  55. data/spec/filefield_spec.rb +110 -0
  56. data/spec/filefields_spec.rb +41 -0
  57. data/spec/form_spec.rb +53 -0
  58. data/spec/forms_spec.rb +42 -0
  59. data/spec/frame_spec.rb +103 -0
  60. data/spec/hidden_spec.rb +105 -0
  61. data/spec/hiddens_spec.rb +40 -0
  62. data/spec/html/forms_with_input_elements.html +107 -0
  63. data/spec/html/frame_1.html +17 -0
  64. data/spec/html/frame_2.html +16 -0
  65. data/spec/html/frames.html +11 -0
  66. data/spec/html/iframes.html +12 -0
  67. data/spec/html/images.html +24 -0
  68. data/spec/html/images/1.gif +0 -0
  69. data/spec/html/images/2.gif +0 -0
  70. data/spec/html/images/3.gif +0 -0
  71. data/spec/html/images/button.jpg +0 -0
  72. data/spec/html/images/circle.jpg +0 -0
  73. data/spec/html/images/map.gif +0 -0
  74. data/spec/html/images/map2.gif +0 -0
  75. data/spec/html/images/minus.gif +0 -0
  76. data/spec/html/images/originaltriangle.jpg +0 -0
  77. data/spec/html/images/plus.gif +0 -0
  78. data/spec/html/images/square.jpg +0 -0
  79. data/spec/html/images/triangle.jpg +0 -0
  80. data/spec/html/non_control_elements.html +85 -0
  81. data/spec/html/tables.html +119 -0
  82. data/spec/ie_spec.rb +146 -0
  83. data/spec/image_spec.rb +210 -0
  84. data/spec/images_spec.rb +39 -0
  85. data/spec/label_spec.rb +65 -0
  86. data/spec/labels_spec.rb +41 -0
  87. data/spec/li_spec.rb +114 -0
  88. data/spec/link_spec.rb +147 -0
  89. data/spec/links_spec.rb +43 -0
  90. data/spec/lis_spec.rb +40 -0
  91. data/spec/map_spec.rb +83 -0
  92. data/spec/maps_spec.rb +41 -0
  93. data/spec/p_spec.rb +140 -0
  94. data/spec/pre_spec.rb +110 -0
  95. data/spec/pres_spec.rb +41 -0
  96. data/spec/ps_spec.rb +40 -0
  97. data/spec/radio_spec.rb +260 -0
  98. data/spec/radios_spec.rb +43 -0
  99. data/spec/select_list_spec.rb +286 -0
  100. data/spec/select_lists_spec.rb +47 -0
  101. data/spec/span_spec.rb +156 -0
  102. data/spec/spans_spec.rb +65 -0
  103. data/spec/spec.opts +1 -0
  104. data/spec/spec_helper.rb +90 -0
  105. data/spec/table_bodies.rb +40 -0
  106. data/spec/table_bodies_spec.rb +42 -0
  107. data/spec/table_body_spec.rb +72 -0
  108. data/spec/table_cell_spec.rb +61 -0
  109. data/spec/table_cells_spec.rb +60 -0
  110. data/spec/table_row_spec.rb +59 -0
  111. data/spec/table_rows_spec.rb +57 -0
  112. data/spec/table_spec.rb +111 -0
  113. data/spec/tables_spec.rb +42 -0
  114. data/spec/text_field_spec.rb +234 -0
  115. data/spec/text_fields_spec.rb +45 -0
  116. data/tasks/environment.rake +7 -0
  117. data/tasks/rspec.rake +23 -0
  118. data/tasks/simple_ci.rake +94 -0
  119. data/tasks/testserver.rake +17 -0
  120. metadata +174 -0
@@ -0,0 +1,42 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "Forms" do
4
+
5
+ before :all do
6
+ @ie = IE.new
7
+ add_spec_checker(@ie)
8
+ end
9
+
10
+ before :each do
11
+ @ie.goto(TEST_HOST + "/forms_with_input_elements.html")
12
+ end
13
+
14
+ describe "#length" do
15
+ it "should return the number of forms in the container" do
16
+ @ie.forms.length.should == 2
17
+ end
18
+ end
19
+
20
+ describe "#[]n" do
21
+ it "should provide access to the nth form" do
22
+ @ie.forms[1].action.should == 'forms_with_input_elements.html'
23
+ @ie.forms[1].attribute_value('method').should == 'post'
24
+ end
25
+ end
26
+
27
+ describe "#each" do
28
+ it "should iterate through forms correctly" do
29
+ @ie.forms.each_with_index do |f, index|
30
+ f.name.should == @ie.form(:index, index+1).name
31
+ f.id.should == @ie.form(:index, index+1).id
32
+ f.class_name.should == @ie.form(:index, index+1).class_name
33
+ end
34
+ end
35
+ end
36
+
37
+ after :all do
38
+ @ie.close
39
+ end
40
+
41
+ end
42
+
@@ -0,0 +1,103 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "Frame" do
4
+ before :all do
5
+ @ie = IE.new
6
+ add_spec_checker(@ie)
7
+ end
8
+
9
+ before :each do
10
+ @ie.goto(TEST_HOST + "/frames.html")
11
+ end
12
+
13
+ it "should handle crossframe javascript" do
14
+ @ie.frame(:id, "frame_1").text_field(:name, 'senderElement').value.should == 'send_this_value'
15
+ @ie.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'old_value'
16
+ @ie.frame(:id, "frame_1").button(:id, 'send').click
17
+ @ie.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'send_this_value'
18
+ end
19
+
20
+ # Exists
21
+ describe "#exist?" do
22
+ it "should return true if the frame exists" do
23
+ @ie.frame(:id, "frame_1").should exist
24
+ @ie.frame(:id, /frame/).should exist
25
+ @ie.frame(:name, "frame1").should exist
26
+ @ie.frame(:name, /frame/).should exist
27
+ @ie.frame(:src, "frame_1.html").should exist
28
+ @ie.frame(:src, /frame_1/).should exist
29
+ @ie.frame(:class, "half").should exist
30
+ @ie.frame(:class, /half/).should exist
31
+ @ie.frame(:index, 1).should exist
32
+ @ie.frame(:xpath, "//frame[@id='frame_1']").should exist
33
+ end
34
+ it "should return true if the iframe exists" do
35
+ @ie.goto(TEST_HOST + "/iframes.html")
36
+ @ie.frame(:id, "frame_1").should exist
37
+ @ie.frame(:id, /frame/).should exist
38
+ @ie.frame(:name, "frame1").should exist
39
+ @ie.frame(:name, /frame/).should exist
40
+ @ie.frame(:src, "frame_1.html").should exist
41
+ @ie.frame(:src, /frame_1/).should exist
42
+ @ie.frame(:class, "iframe").should exist
43
+ @ie.frame(:class, /iframe/).should exist
44
+ @ie.frame(:index, 1).should exist
45
+ @ie.frame(:xpath, "//iframe[@id='frame_1']").should exist
46
+ end
47
+ #TODO: default how = name
48
+ it "should return false if the frame doesn't exist" do
49
+ @ie.frame(:id, "no_such_id").should_not exist
50
+ @ie.frame(:id, /no_such_id/).should_not exist
51
+ @ie.frame(:name, "no_such_text").should_not exist
52
+ @ie.frame(:name, /no_such_text/).should_not exist
53
+ @ie.frame(:src, "no_such_src").should_not exist
54
+ @ie.frame(:src, /no_such_src/).should_not exist
55
+ @ie.frame(:class, "no_such_class").should_not exist
56
+ @ie.frame(:class, /no_such_class/).should_not exist
57
+ @ie.frame(:index, 1337).should_not exist
58
+ @ie.frame(:xpath, "//frame[@id='no_such_id']").should_not exist
59
+ end
60
+ it "should raise ArgumentError when what argument is invalid" do
61
+ lambda { @ie.frame(:id, 3.14).exists? }.should raise_error(ArgumentError)
62
+ end
63
+ it "should raise MissingWayOfFindingObjectException when how argument is invalid" do
64
+ lambda { @ie.frame(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
65
+ end
66
+ end
67
+
68
+ it "should raise UnknownFrameException when accessing elements inside non-existing frame" do
69
+ lambda { @ie.frame(:name, "no_such_name").p(:index, 1).id }.should raise_error(UnknownFrameException)
70
+ end
71
+ it "should raise UnknownFrameException when accessing a non-existing frame" do
72
+ lambda { @ie.frame(:name, "no_such_name").p(:index, 1).id }.should raise_error(UnknownFrameException)
73
+ end
74
+ it "should raise UnknownFrameException when accessing a non-existing subframe" do
75
+ lambda { @ie.frame(:name, "frame1").frame(:name, "no_such_name").p(:index, 1).id }.should raise_error(UnknownFrameException)
76
+ end
77
+ it "should raise UnknownObjectException when accessing a non-existing element inside an existing frame" do
78
+ lambda { @ie.frame(:index, 1).p(:index, 1337).id }.should raise_error(UnknownObjectException)
79
+ end
80
+ it "should be able to send a value to another frame by using Javascript" do
81
+ end
82
+
83
+ describe "#contains_text" do
84
+ it "should find text in a frame" do
85
+ @ie.frame(:name, 'frame1').contains_text('Suspendisse sit amet nisi.').should be_instance_of(Fixnum)
86
+ end
87
+ it "should raise ArgumentError when given an invalid argument" do
88
+ lambda { @ie.frame(:name, 'frame1').contains_text(3.14) }.should raise_error(ArgumentError)
89
+ end
90
+ end
91
+
92
+ describe "#to_s" do
93
+ it "should return a human readable representation of the frame" do
94
+ @ie.frame(:index, 1).to_s.should == "tag: frame\n" +
95
+ " src: frame_1.html\n" +
96
+ " id: frame_1\n" +
97
+ " name: frame1\n" +
98
+ " class: half"
99
+ end
100
+ end
101
+
102
+ end
103
+
@@ -0,0 +1,105 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ # TODO: specs for exceptions
4
+
5
+ describe "Hidden" do
6
+
7
+ before :all do
8
+ @ie = IE.new
9
+ add_spec_checker(@ie)
10
+ end
11
+
12
+ before :each do
13
+ @ie.goto(TEST_HOST + "/forms_with_input_elements.html")
14
+ end
15
+
16
+ # Exist method
17
+ describe "#exists?" do
18
+ it "should return true if the element exists" do
19
+ @ie.hidden(:id, 'new_user_interests_dolls').should exist
20
+ @ie.hidden(:id, /new_user_interests_dolls/).should exist
21
+ @ie.hidden(:name, 'new_user_interests').should exist
22
+ @ie.hidden(:name, /new_user_interests/).should exist
23
+ @ie.hidden(:value, 'dolls').should exist
24
+ @ie.hidden(:value, /dolls/).should exist
25
+ #need to figure out what :text means
26
+ @ie.hidden(:text, 'dolls').should exist
27
+ @ie.hidden(:text, /dolls/).should exist
28
+ @ie.hidden(:class, 'fun').should exist
29
+ @ie.hidden(:class, /fun/).should exist
30
+ @ie.hidden(:index, 1).should exist
31
+ @ie.hidden(:xpath, "//input[@id='new_user_interests_dolls']").should exist
32
+ end
33
+ it "should return false if the element does not exist" do
34
+ @ie.hidden(:id, 'no_such_id').should_not exist
35
+ @ie.hidden(:id, /no_such_id/).should_not exist
36
+ @ie.hidden(:name, 'no_such_name').should_not exist
37
+ @ie.hidden(:name, /no_such_name/).should_not exist
38
+ @ie.hidden(:value, 'no_such_value').should_not exist
39
+ @ie.hidden(:value, /no_such_value/).should_not exist
40
+ @ie.hidden(:text, 'no_such_text').should_not exist
41
+ @ie.hidden(:text, /no_such_text/).should_not exist
42
+ @ie.hidden(:class, 'no_such_class').should_not exist
43
+ @ie.hidden(:class, /no_such_class/).should_not exist
44
+ @ie.hidden(:index, 1337).should_not exist
45
+ @ie.hidden(:xpath, "//input[@id='no_such_id']").should_not exist
46
+ end
47
+ it "should raise ArgumentError when what argument is invalid" do
48
+ lambda { @ie.hidden(:id, 3.14).exists? }.should raise_error(ArgumentError)
49
+ end
50
+ it "should raise MissingWayOfFindingObjectException when how argument is invalid" do
51
+ lambda { @ie.hidden(:no_such_how, 'some_value').exists? }.should raise_error(MissingWayOfFindingObjectException)
52
+ end
53
+ end
54
+
55
+
56
+ # Attribute methods
57
+ describe "#id" do
58
+ it "should return the id attribute if the text field exists" do
59
+ @ie.hidden(:index, 1).id.should == "new_user_interests_dolls"
60
+ end
61
+ it "should raise UnknownObjectException if the text field doesn't exist" do
62
+ lambda { @ie.hidden(:index, 1337).id }.should raise_error(UnknownObjectException)
63
+ end
64
+ end
65
+
66
+ describe "#name" do
67
+ it "should return the name attribute if the text field exists" do
68
+ @ie.hidden(:index, 1).name.should == "new_user_interests"
69
+ end
70
+ it "should raise UnknownObjectException if the text field doesn't exist" do
71
+ lambda { @ie.hidden(:index, 1337).name }.should raise_error(UnknownObjectException)
72
+ end
73
+ end
74
+
75
+ describe "#type" do
76
+ it "should return the type attribute if the text field exists" do
77
+ @ie.hidden(:index, 1).type.should == "hidden"
78
+ end
79
+ it "should raise UnknownObjectException if the text field doesn't exist" do
80
+ lambda { @ie.hidden(:index, 1337).type }.should raise_error(UnknownObjectException)
81
+ end
82
+ end
83
+
84
+ describe "#value" do
85
+ it "should return the value attribute if the text field exists" do
86
+ @ie.hidden(:index, 1).value.should == "dolls"
87
+ end
88
+ it "should raise UnknownObjectException if the text field doesn't exist" do
89
+ lambda { @ie.hidden(:index, 1337).value }.should raise_error(UnknownObjectException)
90
+ end
91
+ end
92
+
93
+ # Manipulation methods
94
+ describe "#value=" do
95
+ it "should set the value of the element" do
96
+ @ie.hidden(:id, 'new_user_interests_dolls').value = 'guns'
97
+ @ie.hidden(:id, "new_user_interests_dolls").value.should == 'guns'
98
+ end
99
+ end
100
+
101
+ after :all do
102
+ @ie.close
103
+ end
104
+ end
105
+
@@ -0,0 +1,40 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "Hiddens" do
4
+ before :all do
5
+ @ie = IE.new
6
+ add_spec_checker(@ie)
7
+ end
8
+
9
+ before :each do
10
+ @ie.goto(TEST_HOST + "/forms_with_input_elements.html")
11
+ end
12
+
13
+ describe "#length" do
14
+ it "should return the number of hiddens" do
15
+ @ie.hiddens.length.should == 1
16
+ end
17
+ end
18
+
19
+ describe "#[]" do
20
+ it "should return the Hidden at the given index" do
21
+ @ie.hiddens[1].id.should == "new_user_interests_dolls"
22
+ end
23
+ end
24
+
25
+ describe "#each" do
26
+ it "should iterate through hiddens correctly" do
27
+ @ie.hiddens.each_with_index do |h, index|
28
+ h.name.should == @ie.hidden(:index, index+1).name
29
+ h.id.should == @ie.hidden(:index, index+1).id
30
+ h.value.should == @ie.hidden(:index, index+1).value
31
+ end
32
+ end
33
+ end
34
+
35
+ after :all do
36
+ @ie.close
37
+ end
38
+
39
+ end
40
+
@@ -0,0 +1,107 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Forms with input elements</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <h1><a href="">User administration</a></h1>
9
+ <h2>Add user</h2>
10
+ <form action="forms_with_input_elements.html" method="post" id="new_user" class="user">
11
+ <fieldset>
12
+ <legend>Personal information</legend>
13
+ <label for="new_user_first_name" id="first_label">First name</label>
14
+ <input name="new_user_first_name" id="new_user_first_name" class="name" /> <br />
15
+ <label for="new_user_first_name">Last name</label>
16
+ <input type="no_such_type" name="new_user_last_name" id="new_user_last_name" class="name" /> <br />
17
+ <label for="new_user_email">Email address</label>
18
+ <input type="text" name="new_user_email" id="new_user_email" /> <br />
19
+ <label for="new_user_country">Country</label>
20
+ <select name="new_user_country" id="new_user_country" class="country">
21
+ <option class="scandinavia">Denmark</option>
22
+ <option class="scandinavia" selected="selected">Norway</option>
23
+ <option class="scandinavia">Sweden</option>
24
+ <option>United Kingdom</option>
25
+ <option>USA</option>
26
+ </select> <br />
27
+ <label for="new_user_occupation">Occupation</label>
28
+ <input type="text" name="new_user_occupation" id="new_user_occupation" value="Developer" /> <br />
29
+ <label for="new_user_species">Species</label>
30
+ <input type="text" name="new_user_species" id="new_user_species" value="Homo sapiens sapiens" disabled="disabled" /> <br />
31
+ <label for="new_user_code">Personal code</label>
32
+ <input type="text" title="Your personal code" name="new_user_code" id="new_user_code" value="HE2FF8" readonly="readonly" /> <br />
33
+ <label for="new_user_languages">Languages</label>
34
+ <select name="new_user_languages" id="new_user_languages" multiple="multiple">
35
+ <option>Danish</option>
36
+ <option selected="selected">English</option>
37
+ <option selected="selected">Norwegian</option>
38
+ <option>Swedish</option>
39
+ </select> <br />
40
+ <label for="new_user_portrait">Portrait</label>
41
+ <input type="file" name="new_user_portrait" id="new_user_portrait" class="portrait" title="Smile!" /> <br />
42
+ <label for="new_user_portrait">Dental records</label>
43
+ <input type="file" name="new_user_teeth" id="new_user_teeth" title="Smile here too!" />
44
+ </fieldset>
45
+ <fieldset>
46
+ <legend>Login information</legend>
47
+ <label for="new_user_username">Username (max 20 characters)</label>
48
+ <input type="text" name="new_user_username" id="new_user_username" maxlength="20" size="20" /> <br />
49
+ <label for="new_user_password">Password</label>
50
+ <input type="password" name="new_user_password" id="new_user_password" /> <br />
51
+ <label for="new_user_role">Role</label>
52
+ <select name="new_user_role" id="new_user_role" disabled="disabled">
53
+ <option>Administrator</option>
54
+ <option>Moderator</option>
55
+ <option>Regular user</option>
56
+ </select>
57
+ </fieldset>
58
+ <fieldset>
59
+ <legend>Interests</legend>
60
+ <input type="checkbox" name="new_user_interests" id="new_user_interests_books" value="books" checked="checked" /> <label for="new_user_interests_books">Books</label>
61
+ <input type="checkbox" name="new_user_interests" value="bowling" /> <label>Bowling</label>
62
+ <input type="checkbox" name="new_user_interests" id="new_user_interests_cars" value="cars" /> <label for="new_user_interests_cars">Cars</label>
63
+ <input type="checkbox" name="new_user_interests" id="new_user_interests_dancing" value="dancing" class="fun" title="Dancing is fun!" /> <label for="new_user_interests_dancing">Dancing</label>
64
+ <input type="checkbox" name="new_user_interests" id="new_user_interests_dentistry" value="dentistry" disabled="disabled" /> <label for="new_user_interests_dentistry">Dentistry</label>
65
+ <input type="hidden" name="new_user_interests" id="new_user_interests_dolls" value="dolls" class="fun" />
66
+ <input type="checkbox" id="new_user_interests_food" value="food" /> <label for="new_user_interests_food">Food</label>
67
+ </fieldset>
68
+ <fieldset>
69
+ <legend>Preferences</legend>
70
+ <p>Do you want to recieve our newslettter?</p>
71
+ <input type="radio" name="new_user_newsletter" id="new_user_newsletter_yes" value="yes" checked="checked" class="huge" />
72
+ <label for="new_user_newsletter_yes">Yes</label>
73
+ <input type="radio" name="new_user_newsletter" id="new_user_newsletter_no" value="no" title="Traitor!" />
74
+ <label for="new_user_newsletter_no">No</label>
75
+ <input type="radio" name="new_user_newsletter" value="certainly" />
76
+ <label>Certainly</label>
77
+ <input type="radio" id="new_user_newsletter_absolutely" value="absolutely" />
78
+ <label for="new_user_newsletter_absolutely">Absolutely</label>
79
+ <input type="radio" name="new_user_newsletter" id="new_user_newsletter_nah" value="nah" disabled="disabled" />
80
+ <label for="new_user_newsletter_nah">Nah</label>
81
+ </fieldset>
82
+ <fieldset>
83
+ <legend>Actions</legend>
84
+ <input type="submit" title="Submit the form" name="new_user_submit" id="new_user_submit" value="Submit" />
85
+ <input type="reset" name="new_user_reset" id="new_user_reset" value="Reset" />
86
+ <input type="button" name="new_user_button" id="new_user_button" value="Button" onclick="this.value = 'new_value_set_by_onclick_event'" />
87
+ <button name="new_user_button_2">Button 2</button>
88
+ <input type="image" class="image" name="new_user_image" src="images/button.jpg" alt="Submittable button" />
89
+ <input type="submit" name="new_user_submit_disabled" value="Disabled" disabled="disabled" />
90
+ </fieldset>
91
+ </form>
92
+ <h2>Delete user</h2>
93
+ <form id="delete_user" action="tables.html">
94
+ <fieldset>
95
+ <label for="delete_user_username">Username</label>
96
+ <select name="delete_user_username" id="delete_user_username">
97
+ <option>Username 1</option>
98
+ <option>Username 2</option>
99
+ <option>Username 3</option>
100
+ </select> <br />
101
+ <label for="delete_user_comment">Comment</label>
102
+ <textarea name="delete_user_comment" id="delete_user_comment">Default comment.</textarea> <br />
103
+ <input type="submit" name="delete_user_submit" id="delete_user_submit" value="Delete" />
104
+ </fieldset>
105
+ </form>
106
+ </body>
107
+ </html>
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frame 1</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <h1>Frame 1</h1>
9
+ <p>Nam accumsan. Donec nisi pede, interdum eget, ultrices ac, vulputate vitae, nunc. Nulla lorem. Duis cursus pharetra dolor. Nulla accumsan hendrerit leo. Vivamus commodo. Nullam dignissim adipiscing est. Aliquam vitae orci in risus lobortis luctus. Ut luctus fermentum ligula. Nullam ipsum. Suspendisse sit amet nisi.</p>
10
+ <form action="" method="post" name="senderForm">
11
+ <fieldset>
12
+ <input type="text" name="senderElement" value="send_this_value" />
13
+ <input type="button" id="send" onclick="parent.frame2.document.recieverForm.recieverElement.value = document.senderForm.senderElement.value" value="Send!" />
14
+ </fieldset>
15
+ </form>
16
+ </body>
17
+ </html>
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frame 2</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <h1>Frame 2</h1>
9
+ <p>Vestibulum dignissim mauris id tellus. Nulla volutpat bibendum ante. Nam malesuada, lacus vel ultrices luctus, lorem purus tristique magna, quis pharetra leo ipsum nec neque. Cras ornare tincidunt sem. In hac habitasse platea dictumst. Suspendisse commodo turpis at est. Sed quis tortor. Aenean non massa. Phasellus scelerisque nulla vel lectus. Quisque lorem. Praesent volutpat dignissim risus. Fusce vulputate ligula eu ipsum.</p>
10
+ <form action="" method="post" name="recieverForm">
11
+ <fieldset>
12
+ <input type="text" name="recieverElement" value="old_value" />
13
+ </fieldset>
14
+ </form>
15
+ </body>
16
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frames</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <frameset cols="50%, 50%">
8
+ <frame src="frame_1.html" id="frame_1" name="frame1" class="half" />
9
+ <frame src="frame_2.html" id="frame_2" name="frame2" class="half" />
10
+ </frameset>
11
+ </html>