HTML - How to pre-populate form field with known value upon load?

前端 未结 4 1842
长情又很酷
长情又很酷 2020-12-18 19:34

I have this web page, say Home.html, that has links to other employee-related web sites. There is one, say www.SomeSite.com/HR.xyz, where it has a form to login. There are

4条回答
  •  旧巷少年郎
    2020-12-18 19:56

    You could try using a get request to populate the input box in the form. That's only if the url like you said is as such www.SomeSite.com/HR.xyz?company=MyCo. In PHP you would simply include:

    " maxlength='50' size="25">

    As you can see that within the value attribute is a echo statement that echoes the get request in the URI where HR.xyz?company=MyCo contains the company get request. If you are using just pure html with no scripting language like php the only other method is by having this code:

提交回复
热议问题