Creating HTML forms
creating html forms
creating html forms are use to collect data or information from users .Using html forms and the mixes of some php codes will allowed you to do so. U can create html form using <form> tag. Html forms contain form element, and are in different types of input elements such as check boxes, radio button, submit buttons, and many others. the <input> element is the most used element in creating html forms. It is an unpaired tag. You have to use attribute type with the <input> element to make it work.
types of type attribute: text,radio, password, checkbox, button, submit, color, date, datetime-local, email, number, range, search, tel, line url, weeks months, years, etc
examples as follow:radio button input
Attribute type="text" is used in input element, it let the user to choose just one from some choices eg<input type="radio" name="age" value="baby">Baby boy<br>
<input type="radio" name="age" value="small">Small boy<br>
<input type="radio" name="age" value="big">Big boy<br>
<input type="radio" name="age" value="man">Man<br>
<input type="radio" name="age" value="giant">Giant man<br>
<input type="radio" name="age" value="small">Others<br>
</form>
here is the output:
dropdowns(combo-boxes)
<input type="checkbox" name="gender"/>Male <br>
<input type="checkbox" name="gender"/>FeMale <br>
</form>
here is an output:
combo-box<option value="2">Two</option><br>
<option value="3">Three</option><br>
<option value="4">Four</option><br>
<option value="5">Five</option><br>
</select> </form><br>
here is output:
combo-box with multiple selection enable
<option value="1">One</option><br>
<option value="2">Two</option><br>
<option value="3">Three</option><br>
<option value="4">Four</option><br>
<option value="5">Five</option> </select><br>
</form>
here is output:
text area, password,submit, file upload, and reset button
<input type="text" value="12345" size="5" maxlength="3"><br>
<input type="text"><br>
<input type="file" name="fileupload" accept="image/*" />
Password : <input type="password"><br&g
t <textarea cols="5" rows="5"></textarea><br>
<input type="button" value="submit"><br>
<input type="reset" name="reset" value="Reset">
</form>
here is output: