1

I want to execute some javascript in a Visualforce page:

 function newWasteAssessment(){
           var siteid = '{!siteID}';
           console.log('new waste assess: '+siteid);
           if(sforce.one){
               console.log('it works;2');
               sforce.one.createRecord('Waste_Assessment__c',null,{'Site__c':siteid});
           }
       }

        function showpopup(){
            console.log('SHOWPOPUP');
            var popup = document.getElementById("popup");
            if(popup)
                console.log("got POPUP!");
        }

I can't use document.getElementById("popup"); to get an apex:outputPanel

so I changed this:

<apex:outputpanel id="popup" style="diplay: none; background-color: #DBFAFB; border-style: solid;border-width: 2px;left: 30%;padding: 10px;position: absolute;z-index: 9999;width: 500px;top:1200px;">
    <apex:form >
        <!--<apex:selectRadio value="{!newWARecordType}">
            <apex:selectOptions value="{!LAWARecordTypes}"/>
        </apex:selectRadio> -->
        <apex:commandbutton type="button">Select 4</button>
    </apex:form>
</apex:outputpanel>

to this:

 <!-- Waste Assessment record type selection pop up -->
<div id="popup" style="diplay: none; background-color: #DBFAFB; border-style: solid;border-width: 2px;left: 30%;padding: 10px;position: absolute;z-index: 9999;width: 500px;top:1200px;">
    <form >
        <!--<apex:selectRadio value="{!newWARecordType}">
            <apex:selectOptions value="{!LAWARecordTypes}"/>
        </apex:selectRadio> -->
        <button type="button">Select 4</button>
    </form>
</div>

but I still want to use some apex variables in my radio button group. How can I do this ? Right now if I use the apex select radio inside the plain form elemtn I get the ( under ) must be between tags error.

Your Answer

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

Browse other questions tagged or ask your own question.