[英]How to keep the textbox value while moving to the next page without using local storage?
Hai every one i have a 2 textbox and 1 button in page1.html
.when click into the the button it redirect into the page2.html
.In page2.html
i press the back button it goes to the page1.html
.When moving to the page1 i need to get the textbox value what i have enterd.Anybody Hai每个人我在page1.html
都有一个2 文本框和一个按钮 。单击该按钮时,它将重定向到page2.html
。在page2.html
我按返回按钮将转到page1.html
。 page1我需要获取输入的文本框值。
kindly guide me 请指导我
You'll need to use some form of Javascript, as HTML doesn't contain a way of controlling values between pages. 您将需要使用某种形式的Javascript,因为HTML不包含一种控制页面之间值的方法。 This is either client scripted, server-side coded or browser feature. 这是客户端脚本,服务器端编码或浏览器功能。
To do it in Javascript (without JQuery), look at something like this . 要做到这一点的Javascript(不JQuery的),看东西像这样 。 I'm not sure why you don't want to do jQuery, it will make some things easier. 我不确定您为什么不想使用jQuery,它将使某些事情变得更容易。 In case you change your mind, there's plenty of cookie plugins available for it. 如果您改变主意,可以使用许多Cookie插件。
jQuery method is here: jQuery BBQ . jQuery方法在这里: jQuery BBQ 。
As long as textboxes are not hidden and were created before load event, they will retain value. 只要未隐藏文本框并在加载事件之前创建文本框,它们就会保留值。
If for some reason you don't want to show them to users than you can trick to have textboxes with positioned absolute, but setting left = -99999px. 如果由于某种原因您不想向用户显示它们,则可以欺骗使文本框具有绝对位置,但是将left设置为-99999px。 This will hide them from screen. 这将从屏幕上隐藏它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.