The datalist Element


The <datalist> element specifies a list of pre-defined options for an <input> element.

Users will see a drop-down list of the pre-defined options as they input data.

The list attribute of the <input> element, must refer to the id attribute of the <datalist> element.


Live Demo & Try it yourself! Read More » »

The output Element


The <output> element represents the result of a calculation (like one performed by a script).


Live Demo & Try it yourself! Read More » »

Input Type Text


HTML Input Types

Here are the different input types you can use in HTML:

  • <input type="button">
  • <input type="checkbox">
  • <input type="color">
  • <input type="date">
  • <input type="datetime-local">
  • <input type="email">
  • <input type="file">
  • <input type="hidden">
  • <input type="image">
  • <input type="month">
  • <input type="number">
  • <input type="password">
  • <input type="radio">
  • <input type="range">
  • <input type="reset">
  • <input type="search">
  • <input type="submit">
  • <input type="tel">
  • <input type="text">
  • <input type="time">
  • <input type="url">
  • <input type="week">

Live Demo & Try it yourself! Read More » »

Input Type Color


The <input type="color"> is used for input fields that should contain a color.

Depending on browser support, a color picker can show up in the input field.


Live Demo & Try it yourself! Read More » »

Input Type Date


The <input type="date"> is used for input fields that should contain a date.

Depending on browser support, a date picker can show up in the input field.


Live Demo & Try it yourself! Read More » »

Date Field Restrictions


You can also use the min and max attributes to add restrictions to dates:


Live Demo & Try it yourself! Read More » »

Input Type Datetime-local


The <input type="datetime-local"> specifies a date and time input field, with no time zone.

Depending on browser support, a date picker can show up in the input field.


Live Demo & Try it yourself! Read More » »

Input Type Email


The <input type="email"> is used for input fields that should contain an e-mail address.

Depending on browser support, the e-mail address can be automatically validated when submitted.

Some smartphones recognize the email type, and add ".com" to the keyboard to match email input.


Live Demo & Try it yourself! Read More » »

Input Type Image


The <input type="image"> defines an image as a submit button.

The path to the image is specified in the src attribute.


Live Demo & Try it yourself! Read More » »

Input Type File


ਫਾਈਲ ਅਪਲੋਡ ਕੰਟਰੋਲ (FILE UPLOAD CONTROL) : 
ਜੇ ਅਸੀ ਕਿਸੇ ਯੂਜ਼ਰ ਨੂੰ ਉਸਦੇ ਕੰਪਿਊਟਰ ਤੋ ਸਾਡੀ ਵੈੱਬਸਾਈਟ ਤੇ ਇਕ  File Upload ਕਰਨ ਦੀ ਆਗਿਆ ਦੇਣਾ ਚਾਹੁੰਦੇ ਹਾਂ ਤਾਂ ਸਾਨੂੰ ਫਾਈਲ ਅਪਲੋਡ ਕੰਟਰੋਲ ਦੀ ਵਰਤੋ  ਕਰਨ ਦੀ ਜਰੂਰਤ ਪਵੇਗੀ। ਇਸ ਕੰਟਰੋਲ ਨੂੰ ਫਾਈਲ ਸਿਲੈਕਟ ਬਾਕਸ ਵੀ ਕਿਹਾ ਜਾਂਦਾ ਹੈ। ਇਸ ਕੰਟਰੋਲ ਨੂੰ ਬਣਾਉਣ ਲਈ ਅਸੀ   type="file" ਐਟਰੀਬਿਊਟ  ਦੇ ਨਾਲ <input> ਟੈਗ ਦੀ ਵਰਤੋ ਕਰਦੇ ਹਾਂ। ਫਾਈਲ ਅਪਲੋਡ ਕੰਟਰੋਲ  ਦੀ ਬੁਨਿਆਦੀ ਉਦਾਹਰਣ  ਇਸ ਪ੍ਰਕਾਰ ਹੈ:

< input  type ="file" name="fileupload" accept="image/*">

ਸਰਵਰ ~ਸਾਈਡ ਸਕਿਰਪਟਿੰਗ ਭਾਸ਼ਾਵਾ ਜਿਵੇ ਕਿ  JSP, ASP, PHP ਆਦਿ ਲਈ Name  ਐਟਰੀਬਿਊਟ  ਦੀ ਜਰੂਰਤ ਪੈਂਦੀ  ਹੈ ਅਤੇ accept ਐਟਰੀਬਿਊਟ ਸਰਵਰ ਦੁਆਰਾ ਸਵੀਕਾਰ ਕੀਤੀਆ ਜਾਣ ਵਾਲੀਆ ਫਾਈਲਾ ਦੀਆ ਕਿਸਮਾਂ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰਦਾ ਹੈ ਕਿ ਸਰਵਰ ਸਿਰਫ ਤਸਵੀਰ ਦੀ  ਕਿਸਮ ਵਾਲੀਆ ਫਾਈਲਾ (Image type files) ਨੂੰ ਹੀ ਸਵੀਕਾਰ ਕਰੇਗਾ:

 
D./main/front.html
file upload example   ______Browse.......
___     _____ 
choose to file upload 
Data (d.) ^main^      ^
search main   
organize•    New folder  
Document  ^
Download      
Music       bookmarks 
pictures         
video         computer  
win 10(c)       
data(d)     ^ education
                                      
file name   education^   ¤ 
Image file(avcr. avcr. avcr)^
open    cancel
ਯੂਜ਼ਰ ਦੁਆਰਾ ਫਾਈਲ ਸਿਲੈਕਟ ਕੀਤੇ ਜਾਣ ਤੋ ਬਾਅਦ 

 

D.main.form.html
file upload example    
D:/main/education.jpg      browse...........
ਫਾਈਲ  ਅਪਲੋਡ ਕੰਟਰੋਲ ਦੀ ਉਦਾਹਰਣ 

ਜਦੋ ਅਸੀ Browse.... ਬਟਨ ਤੇ ਕਲਿੱਕ ਕਰਦੇ ਹਾਂ ਤਾਂ ਫਾਈਲ ਅਪਲੋਡ ਕਰਨ ਲਈ ਇਕ ਡਾਇਲਾਗ ਬਾਕਸ   choose file to upload open ਹੋਵੇਗਾ। ਫਾਈਲ ਸਿਲੈਕਟ  ਕਰਨ ਤੋ ਬਾਅਦ ਇਸ ਡਾਇਲਾਗ ਬਾਕਸ (box)   ਦੇ  ਓਪਨ button ਤੇ ਕਲਿੱਕ ਕਰੋ। ਸਿਲੈਕਟ ਕੀਤੀ ਗਈ ਫਾਈਲ ਦਾ ਨਾਂ ਐਬਲੋਲਿਊਟ ਪਾਥ ਸਮੇਤ Browse... ਬਟਨ ਦੇ ਨਾਲ  ਲੱਗਦੇ ਰੀਡ ਓਨਲੀ text box   ਵਿਚ ਦਿਖਾਈ ਦੇਵੇਗਾ, 

FILE UPLOAD CONTROL

 

The <input type="file"> defines a file-select field and a "Browse" button for file uploads.


Live Demo & Try it yourself! Read More » »

Input Type Hidden


The <input type="hidden"> defines a hidden input field (not visible to a user).

A hidden field lets web developers include data that cannot be seen or modified by users when a form is submitted.

A hidden field often stores what database record that needs to be updated when the form is submitted.

Note: While the value is not displayed to the user in the page's content, it is visible (and can be edited) using any browser's developer tools or "View Source" functionality. Do not use hidden inputs as a form of security!


Live Demo & Try it yourself! Read More » »

Input Type Month


The <input type="month"> allows the user to select a month and year.

Depending on browser support, a date picker can show up in the input field.


Live Demo & Try it yourself! Read More » »

Input Type Number


The <input type="number"> defines a numeric input field.

You can also set restrictions on what numbers are accepted.

The following example displays a numeric input field, where you can enter a value from 1 to 5:


Live Demo & Try it yourself! Read More » »

Input Type Range


The <input type="range"> defines a control for entering a number whose exact value is not important (like a slider control). Default range is 0 to 100. However, you can set restrictions on what numbers are accepted with the minmax, and step attributes:


Live Demo & Try it yourself! Read More » »

Input Type Search


The <input type="search"> is used for search fields (a search field behaves like a regular text field).


Live Demo & Try it yourself! Read More » »

Input Type Tel


The <input type="tel"> is used for input fields that should contain a telephone number.


Live Demo & Try it yourself! Read More » »

Input Type Time


The <input type="time"> allows the user to select a time (no time zone).

Depending on browser support, a time picker can show up in the input field.


Live Demo & Try it yourself! Read More » »

Input Type Url


The <input type="url"> is used for input fields that should contain a URL address.

Depending on browser support, the url field can be automatically validated when submitted.

Some smartphones recognize the url type, and adds ".com" to the keyboard to match url input.


Live Demo & Try it yourself! Read More » »

Input Type Week


The <input type="week"> allows the user to select a week and year.

Depending on browser support, a date picker can show up in the input field.


Live Demo & Try it yourself! Read More » »