ad

Saturday, October 29, 2022

HTML File Upload

                    HTML Tag 




1]File Upload Tag


<input type="file">

A control that let's the user selects a file. Use the accept attribute to define the type of files that the control can select.


File Tag program 



 <html>

<body>

<h1>File upload</h1>

 <p>Show  file-select field which allows
a file to be chosen for upload:</p>

 <form action="/action.php">

 Select a file: <input type="file"
name="myFile"><br><br>

<input type="submit">

</form>

</body>

 </html>


HTML File Upload 

Explain Program

Step 1 ]  

<html>

  • root element of an HTML document.
  • All HTML content must placed inside  tag.

Step 2]  

<body>

  • html Contains all  visible content of the webpage.
  • Text, forms, images, and everything users interact inside the <body>.

Step 3] 

<h1>File upload</h1>

  • HTML TAG heading element.
  • <h1> tag  largest and most important heading used as the title of the page or section.
  • Text: "File upload" –  page is about.

Step 4] 

<p>Show file-select field which allows a file to be chosen for upload:</p>

  • <p> defines a paragraph.
  • This gives a brief description of what the user can do on the page: choose a file for uploading.

Step 5] 

  • <form> is used to create an HTML form for user input.

Step 6] 

Select a file: <input type="file" name="myFile">

  • input  line creates the actual file selection field.
  • <input> is the most common form element for user input.

Step 7] 

<br><br>

  • These are line breaks.
  • Each <br> moves the next content to a new line.

Step 8] 

<input type="submit">

  • submit button.

Step 9] 

</form>, </body>, </html>

  • These are closing tags for the elements opened earlier.
  • They mark the end of the form, body, and HTML document.


file Tag Output


File program output



 Reset Tag 

<input type="reset">

Reset tag  isA button that resets the contents of  the form to default values.


Reset tag program 

<!DOCTYPE html>

<html>

<body>

<h2>Reset Button</h2>

<p>Reset button that will be reset
all form values to their default values </p>

 <form action="/action.asp">

 First Name :<input type="text"
name="firstname" value="Surya"><br>

 Last name :<input type="text"
name="lastname" value="Rad><br><br>

 <input type="submit" value="Submit">

<input type="reset">

</form>

<p>If you change the input values
and then click the "Reset"
button,<br> the form-data will
be reset to the default values.</p>

</html>



Reset tag output


Reset tag output

 button Tag

<input type="button">

Buttons are created as the final component of any form. A button lets the user trigger son events like submission of data, upload/download or any kind of alert/message.


Button Tag program 

<!DOCTYPE html>

<html>

<body>

<h2>Input Button</h2>

<input type="button"
onclick="alert("Hello World!")
value="Click Me!">

 </body>

</html>

Button Tag output 

Button Tag output


 Checkbox Tag


<input type="checkbox">

A check box allowing multiple values to be selected/de selected.


Checkbox Tag program 

<html>

 <body>

 <h2>Checkboxes</h2>

<p> The<strong>input type="checkbox"</strong>

defines a checkbox</p>

<form action="/action_page.php">

 <input type="checkbox" name="vehicle1"
value="sports car">

<P>I have sports car</p><br>

<input type="checkbox" name="vehicle2"
value="Luxury Car">

<P>I have a Luxury car</p><br><br>

<input type="submit">

</form>

</body>

</html>

Checkbox Tag output 


Checkbox Tag output

Related Post :-

css column-gap property

create menu card in html

design web page

No comments:

Post a Comment