–– workshop home ––
Workshops
Forms 1 Exercises
Preliminary
- Download
form1.htmlto your desktop - Load FileZilla
- Get connected to
websandbox.boisestate.eduusing your web account and password. Be sure you enter Port 22. - Navigate to /WebSites/workshops/forms1
- Navigate to your personal directory there
- Launch Groupwise and get logged in. Form results will go to your email.
You will edit your desktop copy, upload it to your directory on websandbox, and will view it there.
1. Form
<form method="post" action="SendEmail.php"> </form>
2. Text Field
<form method="post" action="SendEmail.php">
<p><input type="text" /></p>
</form>
3. Submit Button
<form method="post" action="SendEmail.php">
<p>
<input type="text" />
</p>
<p>
<input type="submit" value="Send" />
<input type="reset" />
</p>
</form>
4. More Fields, plus prompts
<form method="post" action="SendEmail.php">
<p>
First Name <input type="text" />
Last Name <input type="text" />
</p>
<p>
Department or Office <input type="text" />
</p>
<p>
<input type="submit" value="Send" />
<input type="reset" />
</p>
</form>
5. Radio Buttons
From here on, I'll include only the new code.
<p> Year<br /> <input type="radio" /> Freshman<br /> <input type="radio" /> Sophomore<br /> <input type="radio" /> Junior<br /> <input type="radio" /> Senior<br /> <input type="radio" /> Graduate<br /> </p>
6. Checkboxes
<p> Areas of Interest<br /> <input type="checkbox" /> Humanities<br /> <input type="checkbox" /> Fine Arts<br /> <input type="checkbox" /> Science<br /> <input type="checkbox" /> Engineering<br /> <input type="checkbox" /> Business<br /> <input type="checkbox" /> Social Science<br /> </p>7.
select<p> <label for="interest"> Select your level of interest in Boise State University </label><br /> <select id="interest" name="level"> <option>I will attend</option> <option>Among my final choices</option> <option>Interested</option> <option>Not very interested</option> <option>No interest</option> </select> </p>8.
textarea<p> Comment<br /> <textarea></textarea> </p>9. Add
name=to all fieldsThis will cause each of your results lines to have an identifying name. Makes the results much easier to read.
10. Options
- set first and last name fields to 30
- set
maxlengthon first name to 20 and see what happens. Remove it.- set width of Department to 90. What happens if you shrink your browser too much?
- on the
textareaset cols to 50 and rows to 7- Make "Idaho resident" Yes checked
- Add
multipleto theselect11. Fieldset
Add
fieldsetandlegendto group the Year and the Areas of Interest. Don't worry about styling yet.12. Labels
Add labels to all form controls.
13. Styling
I'm just going to list the style steps here, one after the other.
- Size the entire form to 60% of the viewport
- Float it right
- Add a background color to the form
- Make the font sans-serif
- Add a border to the whole form
- Put in a heading2 with the text "Interest Query Form"
- Add a background color for the two fieldsets
- Float the fieldsets so they are next to each other rather than one underneath the other
- Set a different background on the legends
- Experiment with borders on the fieldsets and legends
- Make it so the form control doesn't separate from its prompt when you shrink the window
Data Validation
No exercises, only demonstration
