I have a button that redirects to a PDF page where the same controller fills in the information for both. To accomplish this I've been using a Command Button that returns a page reference of the PDF Page.

After a Recent update to the page, both that button and another button on the page have stopped working. The update was to a completely different section and different code on the page, and should not have interfered with either button or their methods in any way.

In the case of the redirect button it now returns a URL that seems to be the pages generated ID of the HTML Element with the value of the button appended.


<div id="buttonPanel" class="panel panel-default">
                                    <form class="form-horizontal">
                                        <div class="panel-body">
                                            <apex:commandButton style="margin-left:2px;" styleClass="btn btn-primary btn-sm pull-right" disabled="false" value="Generate Quote" action="{!gotoPage2}"/>  


public PageReference gotoPage2(){
    String URL = '/apex/QuotePage';
    PageReference pageRef = new PageReference(URL);
    return pageRef;

Starting URL:


Expected Redirect URL:


Actual Redirect URL:

  • 3
    Fyi you can do pageRef = Page.QuotePage
    – Adrian Larson
    Mar 15, 2016 at 14:00
  • @AdrianLarson Thanks for the tip! Any thoughts on why the url is not working correctly? Mar 15, 2016 at 14:23
  • Why are you calling setRedirect(false)? I don't understand the desired behavior.
    – Adrian Larson
    Mar 15, 2016 at 14:28
  • @AdrianLarson to preserve the View State data for the PDF Mar 15, 2016 at 14:31
  • 1
    @MichaelFleming that wasn't the case, I actually found the issue to be something I didn't even know would cause issues: two sets of <form> tags on a page. Apr 4, 2016 at 15:43

1 Answer 1


So what I've discovered is that there were two tags on the web pag as a whole, and it caused a lot of weird issues with javascript and command buttons.

Removing one set of them fixed the issues completely.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .