Attributes of form elements

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 28:- Attributes of form elements

Here are some common attributes that can be used with form elements in HTML:

  • action: Specifies the URL or script that the form data should be sent to when the form is submitted.
  • method: Specifies the HTTP method used to submit the form data, either GET or POST.
  • enctype: Specifies the encoding type used to submit the form data. The default is application/x-www-form-urlencoded, but other options include multipart/form-data for file uploads and text/plain for plain text data.
  • target: Specifies where the form response should be displayed, such as a new tab or window, an iframe, etc.
  • autocomplete: Specifies whether the browser should automatically fill in the form data for the user, either on or off.
  • name: Specifies a unique name for the form element, used to identify it when the form data is submitted.
  • value: Specifies the initial value for the form element, such as the default text for a text input field or the default state for a checkbox.
  • required: Specifies that the form element is required to be filled out before the form can be submitted, either required or optional.
  • disabled: Specifies that the form element should be disabled and cannot be edited by the user, either disabled or enabled.
  • readonly: Specifies that the form element is read-only and cannot be edited by the user, but the value can be sent when the form is submitted, either readonly or editable.

Here is an example of using these attributes with a text input field:

pythonCopy code

<input type="text" name="username" value="Enter your username" autocomplete="off" required>

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