954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

retain input data on page reload

hi guys,

somebody help me please i need to know how to retain any input on page reload. I have 2 chained combo box (province and city) when a user choose a province, the next combobox should be populated. I use a script that reload the form to execute a query that filters the cities under that province. I was able to do that but the input data were gone on reload. do anyone have a sample code that will retain all the input data?

thanks in advance

bluerain25
Newbie Poster
2 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

put it in a session variable.

kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
 

Hey, It is easier if you show us a sample of your script source, so we could help. However

Assuming I have this two elements

Choose CityOhioDenver

Then my Php code may look like:
<?php
require "form_class.php" ;

if(array_key_exists("push",$_pos,)){
if($_POST["cboCity"] == "-1")){

echo " You have not selected a city!";
//Call my Print form function
$formdisp = new form ;
$formdisp ->displayform($_POST["cboCity"]) ;


}

}

?>

I am been a bit OOP Compliant here and assume that you have a form class which you created and invoke. don't mind my MVC paradigm.

hope this helps else post ur script for me here.

hakimkal
Newbie Poster
20 posts since Dec 2007
Reputation Points: 10
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You