Skip to content

Instantly share code, notes, and snippets.

@JamesVanWaza
Created October 27, 2015 00:01
Show Gist options
  • Save JamesVanWaza/1201d50cd11fccd19179 to your computer and use it in GitHub Desktop.
Save JamesVanWaza/1201d50cd11fccd19179 to your computer and use it in GitHub Desktop.
Setting up a form
<form action="form-submission.cfm"></form>
<!--Using the variables from form.html-->
<form action="form-submission.cfm" method="get"></form>
<!--
WHEN TO USE GET
If the form submission is passive (like a search engine query), and without sensitive information.-->
<form action="form-submission.cfm" method="post"></form>
<!--
WHEN TO USE POST
If the form is updating data, or includes sensitive information (password).-->
<!--Form Element-->
<form></form>
<form>
<fieldset>
<legend>Personal Information</legend>
<label>First Name</label>
<input type="text" name=fname><!--fname is used as a variable-->
<label>Last Name</label>
<input type="text" name="lname">
<textarea></textarea>
</fieldset>
<br>
<fieldset>
<legend>Radio Buttons</legend>
<input type="radio" name="gender" value="male">Male<!--only one option can be selected either Male or Female-->
<label>Last Name</label>
<input type="radio" name="gender" value="female">Female
</fieldset>
<input type="Submit">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment