[英]Passing a textfield value from one html page to another
My question may sound naive, but really struggling to do a very simple thing. 我的问题听起来很幼稚,但确实很难做一件简单的事情。 Suppose I have to html page - send.html
and receive.html
. 假设我必须html页面send.html
和receive.html
。
In send.html
page - 在send.html
页面中-
I have text field and a button in like following - 我有文本字段和类似下面的按钮-
<body> <form onsubmit="recieve.html"> <input type="text" id="mytextfield"> <input type="submit" id="submitbutton" value="Go"> </form> </body>
Here I want to put something on the textfield and I want to see that value in the receive page some thing like - Hello 'value of textfield'. 在这里,我想在文本字段上放置一些内容,并希望在接收页面上看到该值,例如-Hello'textfield的值'。 That's it. 而已。
Do I need to use JS cookie for that? 我需要为此使用JS cookie吗? If not, how can I do it in the most simple way? 如果没有,我该如何以最简单的方式进行?
Need help :( 需要帮忙 :(
With javascript you can write a function to store the value in a cookie and read it on the next page. 使用javascript,您可以编写一个函数来将值存储在cookie中并在下一页上读取它。 By the way, your page goes in the action
attribute. 顺便说一句,您的页面进入action
属性。 onsubmit
expects a javascript function, not a page. onsubmit
需要一个javascript函数,而不是页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.