You need to sign in to do that
Don't have an account?

How to make "javascript:history.back()" work in VisualForce
Hi,
I have to create a back button which will do a browser back operation but somehow the onclick="javascript&colonhistory.back();" is not working for the button. Here is the piece of code below.
Can you anyone please suggest me how to do this?
Regards,
Jina
I have to create a back button which will do a browser back operation but somehow the onclick="javascript&colonhistory.back();" is not working for the button. Here is the piece of code below.
Code:
<apex:facet name="footer"> <apex:commandButton onclick="javascript&colonhistory.back();" value="Back"/> </apex:facet>
Can you anyone please suggest me how to do this?
Regards,
Jina
Your best bet is to create a real action for that button, one that determines which section it is on , then calls the proper section to go to
something like this
pagereference back() {
if thirdSection == true
return showSection2();
etc...
}
this will be the most reliable method to build your wizard, and does not depend on javascript Back().