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
.
In send.html
page -
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'. That's it.
Do I need to use JS cookie for that? If not, how can I do it in the most simple way?
Need help :(
The most simple way is PHP. Bottom line is you need something handling the data on the server side.
With javascript you can write a function to store the value in a cookie and read it on the next page. By the way, your page goes in the action
attribute. onsubmit
expects a javascript function, not a page.
精彩评论