开发者

Transferring text from one text box to another at the click of a button?

开发者 https://www.devze.com 2023-03-21 07:42 出处:网络
I\'m putting a two part web form together. The first page is simply a text box asking for an email address and a subscribe button, the second page is the actual web form. I\'m wondering what\'s the HT

I'm putting a two part web form together. The first page is simply a text box asking for an email address and a subscribe button, the second page is the actual web form. I'm wondering what's the HTML code so when a user inputs their email in the text box and clicks subsc开发者_运维技巧ribe, how can the email inputted be transferred to the email text box on the second form. So when the user sees the web form their email is already filled in? Thanks.


To do that you would have to save it the original email in a cookie. Then on the second page in the body onload create a function that retrieves that value from the cookie and sets it to the input box. I would recommend jQuery to ease the task.


  1. Store email at server.
  2. Store email at cookies


since you are not using any server side programming language or don't want to tell us you can use javascript set onsubmit to setup a cookie with your email and then on next form output that cookie.

0

精彩评论

暂无评论...
验证码 换一张
取 消