Ask a Question related to ASP.NET General, Design and Development.
-
Victor Garcia Aprea [MVP] #1
Re: Losing Form data
Hi Matthew,
Changes made to your listbox items at the client-side won't be automatically
persisted to the server. You will need to write some additional code to make
this happen (ie. posting the list of items in a hidden-form field, parsing
it at the server and updating the Items collection accordingly).
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
"Matthew C" <dotnet@noveris.com> wrote in message
news:SYkKa.12090$C83.1180465@newsread1.prod.itd.ea rthlink.net...the> Hello All,
>
> I have two List Boxes on one page, one list box is a populated server-side
> from a data source, the other is initially empty. The page then allowsserver-side> user to move data from the first box to the second (empty) list box via a
> client-size JavaScript.
>
> Once the second box has data in it, the user submits/posts and aserver.> function attempts to read the data.
>
> PROBLEM: The data (in the second box) that is populated through the
> client-side JavaScript is not persistent and does not make it to theloses> The first box maintains its data through postings, but the second box> all data.
>
> Any help is greatly appreciated.
>
> cheers
>
> Matthew
>
>
>
Victor Garcia Aprea [MVP] Guest
-
Losing Data
I'm using coldfusion MX6.1 and usign MS Access 2003 as a database program. We run web survey for class every semester and we had problem reported... -
Losing Data Sourxe
Hi Guys Help me My new coldFusion server was working fine for 12 days from yesterday I got this error message: Data source CodaData... -
Losing mysql connection between form invocations
I'm trying to : 1. display a form to get a user's mysql logon information 2. logon the user to the mysql database, using the informaton gathered... -
[PHP] SESSION variables losing data on WinXP?
I believe all pages in your site are protected by session variables. Try to login first, then go where you want to go. Or try to remark codes which... -
Session Losing Data
Edwin, The directory being "moved" is really a directory being renamed that contains an image file that was just uploaded to a temporary directory.... -
digihoo #2
losing form data
i am validating form data, but when i redirect the user back to the
form page to correct the errors, all of the data they entered has
disappeared.
Please Help.
Thanks
digihoo Guest
-
Pedro #3
Re: losing form data
digihoo wrote:
The browser only displays what you send.> i am validating form data, but when i redirect the user back to the
> form page to correct the errors, all of the data they entered has
> disappeared.
If you want to send the same data a user submitted, you have to save it
between the form processing script and the script that outputs that
form. I'd do that with session variables:
<?php // form processing script
session_start();
if (isset($_POST['userdata']) {
validate_data($_POST); // define according to your needs
$_SESSION['userdata'] = $_POST['userdata'];
}
header('Location: form_output.php');
exit('Redirected <a href="form_output.php">here</a>.');
?>
and
<?php // form output script
session_start();
if (isset($_SESSION['userdata']) {
$useradata = $_SESSION['userdata'];
} else {
$userdata = ''; // or some other default value
}
?>
<form method="post" action="form_process.php">
<input type="text" name="userdata" value="<?php echo $userdata; ?>" />
<input type="submit">
</form>
Happy Coding :-)
--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Pedro Guest
-
digihoo #4
Re: losing form data
i should have been more specific here. the form also loses its data if
the user just clicks the back button - without actually submitting the
data.
when they click forward to the form again, the data is also gone.
i was told that this is caused by a bug in IE 6, and to put:
header("Cache-control: private");
in the code before any HTML. however, this didn't solve the problem.
is there a way to prevent form data from disappearing, whether or not
it has been submitted into post variables?
Thanks
digihoo Guest



Reply With Quote

