Input Type Number
It allows you to enter only number in the input field. If any alphabet is added the browser will prompt that only numbers are allowed.
Attributes of Input Type Number
It allows you to enter only number in the input field. If any alphabet is added the browser will prompt that only numbers are allowed.
Attributes of Input Type Number
- min- used to set the minimum number.
- max- used to set the maximum number.
example
<!Doctype Html>
<html>
<body>
<h1>Input Type Number</h1>
<form>
Enter Numeric Data: <input type="number" min="3" max="100">
</form>
</body>
</html>
Input Type File
It allows you to select a file from local system and save it to the server.
Attributes of Input Type File
- size- defines the width of visible text on the file selection field.
- maxlength- specifies the maximum number of characters that can be entered in the file selection field.
- accept- specifies the type of files that ca be submitted through a file upload.
example
<!Doctype Html>
<html>
<body>
<h1>Input Type file</h1>
<form>
Enter File: <input type="file" >
</form>
</body>
</html>
Input Type hidden
It is used to pass along the variable and values from one form to another. As it's name implies the variable is hidden and not shown by the browser.
Attributes of Input Type Hidden
- name- specifies the name of the hidden field.
- value- specifies the value of the hidden field.
example
<!Doctype Html>
<html>
<body>
<h1>Input Type hidden</h1>
<form>
User : <input type="text" id="name"/><br />
<input type="hidden" id="greetings" value="Hello"/><br />
<input type="submit" onclick="alert(document.getElementById('greetings').value + ' from '+
document.getElementById('name').value)" value="Submit">
</form>
</body>
</html>
0 comments:
Post a Comment