Failed validation produces unexpected results
I’m having a similar problem to showthread.php?t=17413
I have downloaded the two patch files and deleted .dat file, but this had no effect, I’m still getting the problem.
I’m trying to apply form validation, to a user registration form (created with security assistant, as part of an eCart project).
For each field I have set value=’<?php echo((isset($_POST["field-1"]))?$_POST["form_field"]:"") ?>’ this is to save the user re-entering all the data when a validation fails
It’s just not behaving as I expected. I just get empty fields when the validation fails.
To explore further, I have created a simple test page:
<body>
<form action="test.php" name="test" id="test" method="post" target="_self">
<input name="field-1" type="text" value="<?php echo((isset($_POST["field-1"]))?$_POST["field-1"]:"") ?>" size="30" />
<input name="field-2" type="text" value="<?php echo((isset($_POST["field-2"]))?$_POST["field-2"]:"") ?>" size="30" />
<input type="submit" />
</form>
</body>
This works perfectly until I add validation.
Field-1 has no validation, field-2 has ‘required/not-blank’ validation.
The results are:
Null null --> null null (This I expected)
Foo null --> null null (This is not what I hoped for - field-1 should display foo)
Null foo --> null foo (This I expected)
Foo foo --> foo foo (This I expected)
I will attach the test page and the two wa config files, could you take a quick look please?
Thanks
:o)