简体   繁体   中英

How do I get radio value from the previous page after a using backward button?

I was creating a form like this:

if select b, the textbox is disabled, but after this page there is a comfirmation page, and when you use backward button to switch back, the textbox is turned on again, so is there any method in js that can check the radio selection and alter the result before the after is loaded?

hi why dont you store your flag values in html5 storage objects such as sessionStorage/localStorage, visit Html5 Storage Doc to get more details. using this you can store intermediate flags temporaryly/permanently locally and then access your flags and then change the status of textbox depending on the flag

if(sessionStorage.getItem('flag')=='1')
{
document.getElementById("textbox").disabled = true;
}

add above check in your onload function.

while redirecting to next page use

sessionStorage.setItem('flag',1);

to set flag

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM