Java Reference
In-Depth Information
Notice that the name for each checkbox is the same. The reason for this is that when
the page is submitted, the values of all selected checkboxes will be retrieved as an
array of strings from the HTTP request. We will talk about this in detail when we
discuss the output page.
The last thing we need to do is to add a Submit button to our page. After dropping
the button element from the palette into the page, we are prompted to enter
properties for the button.
In this window we can enter the button's Label .
We can also select a type: submit buttons submit a form, reset buttons reset a form's
values to what they were when the page was loaded, and standard buttons are
typically used to fire JavaScript events. Since our button will be used to submit a
form, the appropriate type for our button is submit .
We can also set the button's Initial State to be disabled , doing this would result in
the button being grayed out and the users would be unable to submit the form.
We could optionally enter a name for our button; in most cases this is not necessary
for submit buttons. The only case where entering a name for a submit button would
be useful would be if a form had more than one submit button, and different actions
needed to take place depending on what button was pressed. In a case like this, each
button would have the same name, this name would then become a parameter in the
HTTP request, the value for this parameter would be the label of the button that was
pressed to submit the form.
 
Search WWH ::




Custom Search