0

When my clients submit a form and get an error they're taken to a page with a link to go back. I'm using javascript:history.go(-1) to go back to the form.

I'm loosing my css functionality with background changes and colors, etc. of the form when the client goes back.

I don't want the client to have to re-type everything agian with a refresh.

Is there a way to avoid this?

Knu
  • 14,806
  • 5
  • 56
  • 89
Erik
  • 5,701
  • 27
  • 70
  • 119

2 Answers2

1

Why don't you save all the Data entered in the PHP Session, and (instead of history.go(-1)) Place a link to the Form again, where you check if there are values in the session, and write them in the Form-Field with PHP?

Something like

$_SESSION['name']=$_POST['name']

and backwards..

You could even do that without showing an error Page, and displaying the error on the form itself...

Christian Romeni
  • 192
  • 1
  • 10
0

If the CSS you mention is being entered as part of the form, you might check out using a shim like Sisyphus.js to ensure cross-browser persistence when your user steps back through the form.

rjz
  • 16,182
  • 3
  • 36
  • 35