Keep forms as simple as possible.
Use fieldsets to group related form controls. The first element inside a fieldset must be a legend
element which describes the group.
for
attribute.
Enter your postcode without any spaces. For example, 'KY169AL'.
.form-group
class to create spacing when wrapping label and input pairs.
Addons can be used when the input field is always going to be prefixed with a particular value.
Allows for multiple lines of text.
Uses the native input using type="file"
. This is so:
Please choose one or more options:
Please choose one or more options:
-
-
-
Please choose one or more options:
Please choose one or more options:
-
-
-
Wrap the input you wish to hide with the following code:
Then use the following JavaScript code to show/hide the conditional content:
$(document).ready(function() {
$('input.input-name').change(
function() {
var val = $(this).val();
if(val === "option-value") {
$(".conditional-content").show();
}
else if(val !== "option-value") {
$(".conditional-content").hide();
}
}
);
});
input-name
with the class of the input you wish to affect.option-value
with the option you wish to show conditional content on.
If possible, avoid using select boxes (drop-down lists). Use radio buttons or checkboxes instead.