Login Retreive lost passwordRegister
Search

Forum Index / General / Display a new empty form after submit OK

[ This topic is unsolved! ]

  Fabien jibi 13 July 05 / 22:47  
Hi,

If all the fields are Ok, I would like to display on the next page (after submit) a new empty form (the same one).
How can i do that ?

Thank you very much

Fabien

  Mels van Kooten 13 July 05 / 23:00  
Changed at 13 July 05 / 23:02
You can use javascript after the form is submitted:

<?
// set the commit after correct function 
$form->onCorrect ("doRun");  

// the oncorrect function 
function doRun($data) { 
    print 
"<script language=\"javascript/text\">";
    print 
"window.location.reload();";
    print 
"</script>";
}
?>



BTW. this is not tested ;)

  Fabien jibi 13 July 05 / 23:07  
Well, it does not work.... No error message but no form....

Fabien

  Mels van Kooten 13 July 05 / 23:08  
I'll test it, just a sec.

  Mels van Kooten 13 July 05 / 23:19  
Try this:

<?php
// set the commit after correct function 
$form->onCorrect    ("doRun");  

// the oncorrect function 
function doRun($data) { 
    print 
"<script language=\"javascript\" type=\"text/javascript\">"
    print 
"window.location = document.URL;"
    print 
"</script>";

?>


  Mels van Kooten 13 July 05 / 23:20  
Fabien, can I ask where you're from?

  Fabien jibi 14 July 05 / 00:06  
Well, I am french but I live in Montreal.
Does my english look weird ?:)

  Teye Heimans (Founder) 14 July 05 / 01:30  
 Quote: Fabien jibi
 
Well, I am french but I live in Montreal.
Does my english look weird ?:)


Could you take a look at the french language file to check if it's ok?

And something like this should also work if you haven't send the headers yet:


<?php

function doRun() {
    
header("Location: ".$_SERVER['PHP_SELF'] );
}
?>



BTW: did you know about the function NewPage ?!

  Mels van Kooten 14 July 05 / 08:31  
 Quote: Fabien jibi
 
Well, I am french but I live in Montreal.
Does my english look weird ?:)

Your last name could be from anywhere and whe're gathering all type of language files ;)

  kreatik 23 July 08 / 17:33  
Hi,
You have an another solution with not redirecting ?

  Johan Wiegel (Admin) 23 July 08 / 17:45  
There is no other way

  kreatik 23 July 08 / 19:38  
Changed at 23 July 08 / 19:40
Actually, I use this solution :

<?php
function doRun(){
/*
my saving form...
*/
return false;//at end of function, return false to force form viewed.
}
?>

  Top


powered by PHP-GLOBE   © 2004 - 2008 FormHandler. All rights reserved.   -   Open source license