简体   繁体   English

在不使用本地存储的情况下如何在移至下一页时保持文本框的值?

[英]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.

相关问题 在下一页,上一页移动时,如何在数据列表中保持选中复选框? - How to keep the checkboxes selected during datalist while moving next, previous page? 如何在MVC中使用Ajax更新文本框值而无需页面刷新 - How to update the textbox value without page refresh using ajax in mvc 如何通过使用本地存储来记住输入值? - how to remember inputs value by using local storage? 我如何保持弹出 div 始终打开,即使在页面刷新/重新加载时,直到用户使用 HTML5 本地存储关闭它 - How can i keep a popup div always open, even on page refresh/reload until a user close it using HTML5 local storage 使用本地存储更改值时,如何动态更新其他页面中的文本框? - How to dynamically Update a text-box in a different page when the value changed using Local Storage? 如何在Angular中刷新页面后检索本地存储值? - How to retrieve the local storage value after refresh the page in Angular? 在不刷新页面的情况下显示本地存储变量 - Displaying local storage variables without page refresh 如何将值从文本框传递到没有表单的另一页 - How to pass value from textbox to another page without form 使用本地存储刷新页面后如何保存用户输入 - How to save user inputs after refreshing the page using local storage 如何在移动元素时保持对齐 - how to keep alignment while moving elements
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM