I have a form on my vf page:

<apex:form id="submitComment">
    <apex:pageBlock mode="edit">
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton action="{!saveComments}" value="Submit" styleClass="btn blu btn-data" reRender="theForm"/>
        <apex:inputField value="{!ideaCom.Comment__c}"/>
        <apex:inputHidden value="{!ideaCom.Idea_Lobby__c}" id="mastDet"/>
            document.getElementById('{!$Component.submitComment}').elements['{!$Component.masDet}'].value = :masterID;

My submit button doesn't do anything when clicked. (Also, I'm not sure the script is validating the page id from the :masterdetail variable.)


private ApexPages.StandardController theController; 
public Idea_Comments__c ideaCom {get; set;}

public detExt(ApexPages.StandardController acon) {

   theController = acon;

  public List<Idea_Comments__c> getdetExt()

        ID masterID = theController.getID();

        return [SELECT Id, CreatedDate, CreatedBy.Name, Comment__c
        FROM Idea_Comments__c
        WHERE Idea_Lobby__c = :masterID
        order by CreatedDate DESC ];
  public detExt(){
        ideaCom = new Idea_Comments__c();
  public void saveComments(){
        // insert or update comments - depends on your requirement
            insert ideaCom;
        }catch(Exception ex){
            System.debug('#### Error while inserting comments #### ' + ex.getMessage());

Any idea on why my form isn't submitting?


UPDATE: Here are the errors I get from the console:

Uncaught SyntaxError: Unexpected token : GET https://myorg-developer-edition.na17.force.com/javascript/1418636499000/sfdc/source/main.js.map 503 (Service Unavailable) GET https://myorg-developer-edition.na17.force.com/javascript/1418636499000/sfdc/source/VFState.js.map 503 (Service Unavailable) GET https://myorg-developer-edition.na17.force.com/javascript/1418636498000/sfdc/source/NetworkTracking.js.map 503 (Service Unavailable)

  • 1
    there might be a javascript error, preventing the buttonclick action to be performed. Right click any element on the page, and select 'Inspect Element' (or something similar, depending on browser). The make sure you view the console and then reload the page (F5). That will show you any javascript errors. Dec 16, 2014 at 19:50

2 Answers 2


What guy posted in the comments could likely be your issue, but I have 1 more idea...

Does there exist any form with Id="theForm"? Your example shows a form of Id="submitComment" but not what you are trying to rerender. It is possible that you have that Id somewhere that isn't revealed to us.


<apex:commandButton action="{!saveComments}" value="Submit" styleClass="btn blu btn-data" reRender="submitComment" />

First of all , you need to modify your script like : <script> document.getElementById('{!$Component.submitComment}').elements['{!$Component.masDet}'].value = {!masterID}; </script>

and i think , sf validation does not allow you to execute server side method due to required fields...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.