I've searched the forum and the only thing I found was:
When I simply replace the exit function, I get the page that is displayed after sending the email. When I make sure that no code is executed after the showform (with a simple if condition), then the data doesn't show up, only an empty form.
Did anybody succeeded in keeping the data after a wrong image verification ?
If so, would you please post your modified file or just the modifications here ?
Thanks.<br><br>Post edited by: notexa, at: 2007/09/02 03:45
I have this working OK. You need to set values for the form fields like value="<?php echo $_POST['thisfieldname'] ?> - these will be null when the form first displays.
Then look for the error check in chronocontact.php after if ( !$checkSecurity ) { and replace exit; with showform();
This isn't perfect. I've hacked mine a little more to show the error message through showform($error) and to suppress the sending of e-mail messages, onSubmit code etc.
When I simply replace the exit function, I get the page that is displayed after sending the email. When I make sure that no code is executed after the showform (with a simple if condition), then the data doesn't show up, only an empty form.
Did anybody succeeded in keeping the data after a wrong image verification ?
If so, would you please post your modified file or just the modifications here ?
Thanks.<br><br>Post edited by: notexa, at: 2007/09/02 03:45
Hi notexa,
I have had this working - though this was before Max added validation to ChronoForms. I think that there are a couple of ways to address it (and I'm sure that Max will build it into a future release).
I have to take a phone call right now, but will dig up my work and post it later this morning.
Bob
PS The simplest code hack I've found so far is here
I have had this working - though this was before Max added validation to ChronoForms. I think that there are a couple of ways to address it (and I'm sure that Max will build it into a future release).
I have to take a phone call right now, but will dig up my work and post it later this morning.
Bob
PS The simplest code hack I've found so far is here
Hi notexa,
Reading this again it seems to me that you may have a ReDirect url set. What happens if you temporarily remove that? As far as I can see the showfrom() should display the form with data provided that it hasn't been redirected.
If that makes the difference then putting $rows[0]->redirecturl == ""; immediately after the showform(); command as this should suppress the ReDirect.
Bob
Reading this again it seems to me that you may have a ReDirect url set. What happens if you temporarily remove that? As far as I can see the showfrom() should display the form with data provided that it hasn't been redirected.
If that makes the difference then putting $rows[0]->redirecturl == ""; immediately after the showform(); command as this should suppress the ReDirect.
Bob
You're right, I've got a redirect url set up. I'll try your suggestion later today and post the results.
I tried replacing the exit with
$rows[0]->redirecturl == "";
showform();
in both orders, but it keeps displaying the redirect page.
Hehe, didn't see that one myself.
I changed the code again, but alas. Now the form shows, but the value is still empty.
The code in the php file:
The field code:
Any other ideas ?
I changed the code again, but alas. Now the form shows, but the value is still empty.
The code in the php file:
if ( md5($chrono_verification ) != $_SESSION['chrono_verification'] ) {
showErrorMessage('U heeft de foute code ingegeven.');
showform();
$rows[0]->redirecturl = "";
// exit();
}
The field code:
<label for="afznaam">Naam : </label><input type="text" name="afznaam" id="afznaam" tabindex="810" value="<?php echo $_POST['afznaam']; ?>" size="20" tooltipText="Dit veld is verplicht" /><br />
<label for="afzadres">Adres : </label><input type="text" name="afzadres" id="afzadres" tabindex="811" value="<?php echo $_POST["afzadres"]; ?>" tooltipText="Dit veld is verplicht" /><br />
Any other ideas ?
Hi notexa,
I think that I've got it working. It seems as though the problem is the JavaScript alert - with that in place the form with the data flashed and was instantly replaced by a blank form.
Commenting out that line left just the form with the data.
It does mean that there's no error message though. My earlier version got round this by passing back an error message as a parameter to showform($message).
This works with a hack to function showform() like:
I think that I've got it working. It seems as though the problem is the JavaScript alert - with that in place the form with the data flashed and was instantly replaced by a blank form.
Commenting out that line left just the form with the data.
It does mean that there's no error message though. My earlier version got round this by passing back an error message as a parameter to showform($message).
This works with a hack to function showform() like:
function showform($message = '')
{
global $database, $mosConfig_live_site, $mosConfig_absolute_path;
if ( $message ) {
echo "<div style="border:1px solid silver;border-left:6px solid red;padding:6px;">$message</div>";
}
Bob<br><br>Post edited by: GreyHead, at: 2007/09/03 15:44
Aha, that explains it. I'll give it a go latter today. It might even prove to be a nicer solution when displaying the error under the image verification box.
Thanks for the help !
EDIT: works great now :woohoo:<br><br>Post edited by: notexa, at: 2007/09/03 18:47
Thanks for the help !
EDIT: works great now :woohoo:<br><br>Post edited by: notexa, at: 2007/09/03 18:47
This topic is locked and no more replies can be posted.