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

Pass field value from parent page to modal using slds


I am using visualforce page(not lightning component) and in the page I use slds modal. When I click a button in the page it will open the modal above the page and the parent page greyed out. I want to pass some field values of parent page to modal. Can any one help how to do that. Modal is working fine but want a idea to pass value to modal.

<apex:slds /> <script src="" type="text/javascript"></script>
<button class="slds-button slds-button--brand" id="toggleBtn" onclick="openModal(); return false;">Find</button>

<div class="search">
            <div class="slds-modal" aria-hidden="true" role="dialog" id="modal">
                <div class="slds-modal__container">
                    <header class="slds-modal__header">
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Search</h2>
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <div class="modal-body" id="modBody">
                            <table class="slds-table slds-table_bordered slds-table_cell-buffer">                               
                                        Zip code:
                                        <apex:inputText value="{!inputZipCode}" id="txtZipCode" maxlength="9" />
                    <footer class="slds-modal__footer">
                        <button class="slds-button slds-button_neutral" onclick="closeModal()">Cancel</button>
                        <apex:commandButton value="Search" reRender="modResult, modres" />
            <div class="slds-backdrop" id="backdrop"></div>
            <!-- Modal Toggle Script -->
            j$ = jQuery.noConflict();
            //Modal Open
            function openModal(){
            //Modal Close
            function closeModal(){
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Preyanka,

To Pass a value from parent page to popup to controller​. Hope it will be helps.

Please mark it as best answer if the information is that question is removed from an unanswered question and appear as a proper solution.

Rahul Kumar
Hi Rahul,

I did not get much information from the link you provided.

Do you know without set the value in controller how to pass value from parent page to modal using slds?

Hi Preyanka,
did you find a solution to pass the value without using controller? Can you please share what you did?