Form Attributes

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 31:- Form Attributes

There are several attributes that can be used to control the behavior of an HTML form:

  1. action: Specifies the URL of the page that will process the form data when the form is submitted. For example:

lessCopy code

<form action="https://www.example.com/form-processor"> ... </form>

  1. method: Specifies the HTTP method (e.g. GET or POST) to be used when submitting the form data. For example:

phpCopy code

<form action="https://www.example.com/form-processor" method="post"> ... </form>

  1. enctype: Specifies the encoding type to be used when submitting the form data. The default value is "application/x-www-form-urlencoded". For file uploads, use "multipart/form-data". For example:

phpCopy code

<form action="https://www.example.com/form-processor" method="post" enctype="multipart/form-data"> ... </form>

  1. target: Specifies the target frame or window where the result of the form submission should be displayed. For example:

phpCopy code

<form action="https://www.example.com/form-processor" method="post" target="_blank"> ... </form>

  1. name: Specifies the name of the form, which can be used to access the form and its elements using JavaScript. For example:

phpCopy code

<form action="https://www.example.com/form-processor" method="post" name="contact-form"> ... </form>

  1. onsubmit: Specifies a JavaScript function to be executed when the form is submitted. This can be used to perform form validation before the form data is sent to the server. For example:

phpCopy code

<form action="https://www.example.com/form-processor" method="post" onsubmit="return validateForm()"> ... </form>

4. Forms

2 Comments

@niteshguptav63
niteshguptav63 Nov 17, 2024 at 1:39 PM

I am not able to access videos from second class and further. I have already completed first class

@niteshguptav63
niteshguptav63 Nov 16, 2024 at 10:56 AM

When will I get my course?

@admin79
admin79 Nov 17, 2024 at 1:29 PM

Now, Your query was resolved.

Frequently Asked Questions About Sciaku Courses & Services

Quick answers to common questions about our courses, quizzes, and learning platform

Didn't find what you're looking for?

help_center Contact Support