function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ethan huntethan hunt 

Syntax Error in Javascript

Hi,

 

I am trying to assingn the below mentioned javascript to my custom button on VF page. But i am getting syntax error messsage. Kindly help to resolve.

 

 

 

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}

IF(ISBLANK({!Recruiter__c.CompanyName__c}))
{
alert ("Company Name cannot be blank");
}
else{
window.open('https://c.ap1.visual.force.com/apex/sid19');
}

Best Answer chosen by Admin (Salesforce Developers) 
Dev@Force.ax647Dev@Force.ax647

I am not 100% clear about your requirements. Based on what I understand, you can display all

All Answers

Dev@Force.ax647Dev@Force.ax647

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}

if("{!Recruiter__c.CompanyName__c}"=="")
{
alert ("Company Name cannot be blank");
}
else{
window.open('https://c.ap1.visual.force.com/apex/sid19');
}

Avidev9Avidev9

Seems like a misplaced bracket!

 

 
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
IF({!ISBLANK(Recruiter__c.CompanyName__c)})
{
alert ("Company Name cannot be blank");
}
else{
window.open('https://c.ap1.visual.force.com/apex/sid19');
}

 

ethan huntethan hunt

Hi 

<apex:page standardcontroller="Recruiter__c" renderAs="pdf" >
<center>

<apex:form id="theForm">
<script type="text/javascript">
</script>

<apex:panelGrid columns="1" width="100%" >
<apex:outputText value="{!Recruiter__c.Name}" styleClass="companyName"/>
<apex:outputText value="{!Recruiter__c.CompanyName__c}" style="color:red;font-size:60px"/>
<apex:inputHidden value="{!Recruiter__c.Applied__c}" id="button" />
<apex:outputText value="{!NOW()}"></apex:outputText>
<apex:inputCheckbox value="{!Recruiter__c.Applied__c}" id="chek">
<apex:actionSupport event="onchange" reRender="ButtonId"/>
</apex:inputCheckbox>
<!-- <apex:commandButton value="Render PDF" disabled="{!Recruiter__c.Applied__c==false}" id="Button1"/> -->
</apex:panelGrid>




</apex:form>


</center>
</apex:page>

Dev@Force.ax647Dev@Force.ax647

I am not 100% clear about your requirements. Based on what I understand, you can display all

This was selected as the best answer
ethan huntethan hunt

Thank you...