Forums

Confirmation Page - Review

hungree 24 Aug, 2010
When I click back on the Confirmation page button I would like the form to retain the information the user had added. Is this possible? Whats the best solution to achieve this?
GreyHead 25 Aug, 2010
Hi hungree,

Please set "Republish fields if error occured" to "Try to republish" on the Form Editor General tab.
I think this will do the trick though I'm not certain about the Confirmation Page setup.

Bob
nml375 25 Aug, 2010
Hi,
I roughly recall a similar topic quite some time ago. As I remember it, the solution was to change the cache-headers sent to the browser to prevent it from re-generating the form when using the back-button.
I'll see if I can't find the thread later tonight..

/Fredrik
hungree 26 Aug, 2010
Thanks for both of your help. I was impatient and instead built a confirmation page that contains the form fields again where the user can edit them on the confirmation page instead of pressing back and then they just confirm.

My next challenge is this. I want to calculate the total cost on the confirmation page which by my estimation required some javascript. So I came up with:
<script type="text/javascript">
//Calculate total cost

var total = {order};

if (order < 25)
  {
  document.write("$23.94");
  }
else
  {
  document.write("$47.88");
  }
</script>

Can I use this in the confirmation page? If so how do I get the result to display inside the field I want it to? I'm a newbie to javascript and only kind of understand syntax, have a bit of trouble with implementation. I tried adding it into the form where I suspected it would work but it just shows the actual <script> code and the whole bit instead of rendering any actual javascript.

Any ideas? Thanks again guys this component has been invaluable to me!
nml375 27 Aug, 2010
Hi,
Did you disable the WYSIWYG-editor in the plugin setup?
If it is enabled, the editor will try and parse the string, most likely ending up breaking it..

/Fredrik
GreyHead 27 Aug, 2010
Hi hungree,

As Fredrik says you need to disable the WYWYWYG editor and make a few small tweaks to your script. Then it works OK
<script type="text/javascript">
//Calculate total cost

var total = {order};
window.addEvent('domready', function() {
  if (total < 25) {
    $('total').setHTML('$23.94');
  } else {
    $('total').setHTML('$47.88');
  }
});
</script>
<p>Order: {order}</p>
<div id='total' ></div>


Bob
This topic is locked and no more replies can be posted.