Keep forms as simple as possible, see form example for more information.
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:
Use the following JavaScript code to show and hide the conditional content. Place this code at the bottom of the page, for example after the link to core.js
:
$(document).ready(function() {
$('.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 radio buttons or select box that you wish to affect.option-value
with the option you wish to show conditional content on.
Please select your student status.
Please select your student status.
Use fieldsets to group related form controls. The first element inside a fieldset must be a legend
element that describes the group.
This element uses the native input: type="file"
. This is so the element gains focus when tabbing through the page. It also ensures the element functions when:
Enter your postcode without any spaces. For example, KY169AL.
You must use the .form-group
class to create spacing when wrapping label and input pairs.
Addons map be used when the input field is always going to be prefixed with a particular value, for example collecting only the username for an @st-andrews.ac.uk
email address.
£
.00
@st-andrews.ac.uk
Allows for multiple lines of text.
for
attribute.
If you do ask for optional information, you must mark the labels of optional fields with (optional)
.
These let users choose a single option from a list.
Please select your student status.
Please select your student status.