473,792 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to retain the values when the page is refreshed

vijcbe
16 New Member
Hello friends,
I am having a big time problem.
I have a list of textboxes, radios, etc., in a login page for the user to enter his/her data. I have two drop downs, in which the second one is populated according to the first one's choice. I used javascript onchange function to do this.
Later in the Js, I get the selected value and pass it to PHP again so that the second dropdown is populated accoding to the first choice.

Coding:
Expand|Select|Wrap|Line Numbers
  1. function reload(form)
  2. {
  3. var val=form.select1.options[form.select1.options.selectedIndex].value;
  4.  
  5.  
  6.  
  7. self.location='newuser.php?select1=' + val;
  8. }
The issue is, the total page is getting refreshed and the values so far entered by the user gets erased. I tried to pass all the values to the javascript, and send it back. But it is very hectic and password and other encrypted data will be shown in the address bar. Please someone tell me, how to refresh only the dropdown list and not the page as a whole.
Thanks a million in advance.
Regards,
VJ
Oct 5 '07 #1
2 2426
shane3341436
63 New Member
Well friend,
Are you familiar with SESSION? You need SESSION for this very problem.
You can save all the values in session variables and retrieve them.
Oct 5 '07 #2
pbmods
5,821 Recognized Expert Expert
Heya, VJ.

Please use CODE tags when posting source code:

[CODE=javascrip t]
JavaScript code goes here.
[/CODE]

You can alternatively set the values that you need in a cookie to make them more accessible to JavaScript.
Oct 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5502
by: J P Singh | last post by:
I have simple form where user enter the search criteria and the form is posted back to itself and runs a query based on the values that are entered. Everything is expect the values that the user enters disappears everytime the form is refreshed when posting it to itself. Is there anyway I can retain the values that were entered on the form?
1
2023
by: abdul bari | last post by:
Hi I have a standard html form which is generated by an XSL sheet. The form data is submitted to the server and is passed on to file.aspx for processing. However file.aspx is refreshed every 5 seconds, when this happens the form data is lost, is there anyway whereby when the page is refreshed the form data remains. I thought with ASP.NET all data is maintained- so a refresh will still maintain the form data. The form data is obtained...
0
1856
by: kajir | last post by:
Hi, I am new at using ASP.Net 2.0. I have various drop down lists on my master page. They refer to an SQL database. I also have a menu on the master page. I can select the values in the drop down list and generate reports using Reporting services and parameters on the default page. Now I want to create another kind of report on another page using the same values in the drop down lists. But, when I click on a menu item to change...
2
2892
by: ckmenon | last post by:
I have a page in which there is a drop down list.the values in drop down list are the pages.now in one page i am adding a flag which is in an external window.As soon as I save my flag and the external window gets closed, my parent page where the drop down list is present gets refreshed and the dropdown list value goes to the default value i.e. 1st value.So how to retain the value?. for eg:-4th value.
1
2106
by: srinivasyadavkota | last post by:
Hello experts here, plz help me, When I Scroll down my web page using vertical scroll bar to some point and when refreshed, I was unable to retain back the scrolled position, instead it always goes to the top part of the page. How can I retain this scrolled position even after refreshing the page ? a piece of code helps. Thanks and Regards, SrinivasKota.
1
1638
by: srinivasyadavkota | last post by:
Hi Experts here, Pls help. when I disable the button using the code document.getElementById("mybutton").disable=true; it is disabling perfectly but when the page gets refreshed again it comes to enable position so, I need a code even when the refreshing the page also my button is in disable position.
3
3150
by: raaman rai | last post by:
Hi Fellas, i need to understand how to retain the submtted form values during an Edit/Update operation. When i add the information from a form, i retain the form values in the following way incase there is something missing or the values are incorrect. <input type="text" name="camount" tabindex="4" value="<?php echo $form->value("camount"); ?>" > When i edit this information i retrieve the value in the following manner <input...
10
10922
SaiRockinGuy
by: SaiRockinGuy | last post by:
Hi, How to retain values in jsp using struts2 tags. I am using <s:select></s:select> which has inbuilt properties in it. But the values are not retained when the page gets refreshed.Can anyone help me in this. Thanks in advance!
9
5752
by: sweetline priya | last post by:
hi friends.. in my page the form contains 10 textboxes. the user has to fill these textfields. if the user made any mistake in entering value in any textbox, in the button click, a message is displayed to intimate the user like ' u wrongly enter the value'.. in button click all the textbox values are erased. so can anybody tell me how to retain the value of textbox(without GET method because it is an unsecured one.. since all the values...
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.