简体   繁体   中英

How does the value attribute of HTML <input> tag work?

I new to programming and I am reading this django book and it says that in the template that codes for login page, the value attribute of input can redirect the user to the main page after the user log in successfully.

When I want to find out more I see the HTML documentation but it says the value attribute accepts data to be submited to the server however it does not say how it causes a redirect in the URL. May I please know how does the value attribute cause a redirect to the URL?

I added the Django tag but I am not sure if it's a django question.

代码照片 在此处输入图像描述

When the form is submitted back to the server the value of the "name" attribute tells the server the name of the variable to put that value into.

In this case an input with the name of "next" has specific meaning to Django itself for authentication forms. In this case being used to tell Django which URL to redirect to if the authentication is successful.

https://docs.djangoproject.com/en/3.1/topics/auth/default/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM