0

I am displaying 6 text field using apex repeat. Now i am placing a command link called " Clear Filter" to reset the value to null. I am not able to get the id of the inputtext since it is inside a section. Here is my code

function clearFilter () {
        alert('Inside');
        var a = document.getElementById("{!$Component.searchTextId}").value
        alert('Hiii');
    }
<apex:form id="frm">

    <div class="centered">
        <apex:actionStatus id="LoadingStatus">
        <apex:facet name="start">

        <img src="{!URLFOR($Resource.ProgressIndicator)}" />
        </apex:facet>
        <apex:facet name="stop">
        </apex:facet>
        </apex:actionStatus>        
    </div>

    <div class="centered">
        <apex:actionStatus id="LargeStatus">
            <apex:facet name="start">
            <img src="{!URLFOR($Resource.ProgressIndicatorLarge)}" />
            </apex:facet>
            <apex:facet name="stop">
            </apex:facet>
        </apex:actionStatus>
    </div>
<apex:outputPanel id="out">    
</apex:outputPanel>
<apex:outputPanel id="mainOutputPanel">
    <apex:actionFunction action="{!doAllSearch}" name="showSearch"
    status="LargeStatus"
    reRender="resultBlock,pnlDisplayMsg,resultTable,error,footerPanel" />

    <apex:actionFunction name="mainSearch" action="{!doAllSearch}" status="searchStatus" reRender="resultBlock,error,filterBlock" />

    <apex:actionFunction action="{!relatedContactSearch}" name="searchContactResponse"
    rerender="contact" status="LargeStatus">
    <apex:param value="" assignTo="{!relatedEcid}" name="ecid"/>
    </apex:actionFunction>
    <apex:actionFunction name="nextAccountPage" action="{!nextPage}" oncomplete="document.getElementById('pg').scrollIntoView();"
    reRender="resultBlock,pnlDisplayMsg,resultTable,error,footerPanel" status="LargeStatus" />
    <apex:actionFunction name="previousAccountPage"
    action="{!previousPage}" oncomplete="document.getElementById('pg').scrollIntoView();"
    reRender="resultBlock,pnlDisplayMsg,resultTable" status="LargeStatus" />
    <apex:actionFunction action="{!sortData}" name="sortAccountData"
    reRender="resultBlock,pnlDisplayMsg,resultTable" status="LargeStatus">
    <apex:param name="sortField" assignTo="{!sortField}" value="" />
    </apex:actionFunction>

    <apex:actionFunction action="{!relatedContactSearch}" name="searchMarket"
    rerender="MarketAccount" status="LargeStatus">
    <apex:param value="" assignTo="{!relatedEcid}" name="ecid"/>
    </apex:actionFunction> 

    <apex:pageBlock rendered="{!isPageBlock}" id="pbId"> <!-- --- Search Page block starts here ----->    

    <apex:pageBlockSection columns="1">  <!-- --- Search Page block section starts here ----->    

    <apex:pageBlockSectionItem >
        <apex:outputPanel >
        <apex:inputtext id="searchString" value="{!searchString}" 
        style="width:70%" />
        <script>


        </script>
        <apex:outputLabel value="Search Type: " />
        <apex:selectList value="{!searchOperator}" size="1" style="height: 22px;">
        <apex:selectOption itemLabel="AND" itemvalue="AND"></apex:selectOption>
        <apex:selectOption itemLabel="OR" itemvalue="OR"></apex:selectOption>
        </apex:selectList> &nbsp;&nbsp;

        <apex:actionStatus id="searchStatus">
        <apex:facet name="start">
        <img src="{!URLFOR($Resource.ProgressIndicator)}" />
        </apex:facet>
        <apex:facet name="stop">
        <apex:commandButton value="Search" onclick="mainSearch();return false;" />
        </apex:facet>
        </apex:actionStatus>
        </apex:outputPanel>

    </apex:pageBlockSectionItem> 
    <apex:outputPanel id="filterBlock">

    <apex:pageBlock rendered="{!isLoadPage}" id="pbIdBlk">
    <div style="width:35%;" id="maindiv">
    <apex:pageblocksection >
    <apex:pageblockSectionItem >
    <apex:outputlabel value="Account Filters" style="font-weight:bold"/>
    </apex:pageblockSectionItem>


    <apex:pageblockSectionItem >

    <a href="#" onclick="toggleDiv()" id="showlink" style="display:none;" >HideFilter</a> 
    <a href="#" onclick="toggleDiv()" id="hidelink" >ShowFilter</a>
    </apex:pageblockSectionItem>

    </apex:pageblocksection> 
    </div>

        <apex:outputPanel id="showblock" style="display:none;">
           <apex:pageblockSection columns="3" id="pbsi">
            <apex:repeat value="{!filterArray}" var="a">
              <apex:pageBlockSectionItem >
                <apex:outputLabel value="{!a.label}"/>
                  <apex:inputText value="{!a.SearchValue}" id="searchTextId"/>
              </apex:pageBlockSectionItem>  
              </apex:repeat> 
              <apex:pageblockSectionItem>
                <apex:commandLink value="Clear Filters" onclick = "clearFilter()"/>
              </apex:pageblockSectionItem>
            </apex:pageblockSection>
        </apex:outputPanel>

        <apex:outputPanel id="hideblock" style="display:none;">

        </apex:outputPanel>
    </apex:pageBlock>

    </apex:outputPanel>
    </apex:pageBlockSection> <!-- --- Search Page Section block End here ----->    



    <apex:pageMessages id="error"/>
    <apex:pageBlock id="resultBlock"> <!-- --- Result Page block starts here ----->    
        <!-- Custom Header, apex facet doen't support text and ActionStatus -->
        <div class="pbHeader" style="margin: -0px -12px !important;">

        <table cellspacing="0" cellpadding="0" border="0" id="report">
        <tbody>
        <tr>
        <td class="pbTitle">
        <h2 class="mainTitle"><!-- <nobr>SFDC Data {!IF((searchCount==0 || searchCount>=limitRecords), '', ' [' + TEXT(searchCount) + ']')}</nobr> -->
        Search Results</h2>

        </td>
        <td class="pbButton"><apex:actionStatus id="accountStatus">
        <apex:facet name="start">
        <img src="{!URLFOR($Resource.ProgressIndicator)}" />
        </apex:facet>
        <apex:facet name="stop">
        <apex:commandButton value="New Account" action="{!newSObject}" 
        disabled="{!IF(showNewButton = true, false, true)}" status="accountStatus"
        rendered="{!newAccountAccess}"/>
        </apex:facet>
        </apex:actionStatus></td>
        <td><apex:actionStatus id="statusSFDC">
        <apex:facet name="start">

        <img src="{!URLFOR($Resource.ProgressIndicator)}" />
        </apex:facet>
        </apex:actionStatus></td>
        </tr>
        </tbody>
        </table>
        </div>
        <apex:outputPanel id="resultTable">
        <table width="100%" class="list" border="0" cellspacing="0"
        cellpadding="0">
        <tr class="headerRow">
        <th style="width: 5%;">Action</th>
        <th style="width: 2%;"></th>
        <th style="width: 5%;"><apex:outputPanel >
        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('score');">Relevance<img
        src="{!IF(sortField = 'score',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />
        </apex:outputLink>
        </apex:outputPanel></th>
        <th style="width: 25%;"><apex:outputPanel >
        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('FULL_NAME_AC');">Account Name<img
        src="{!IF(sortField = 'FULL_NAME_AC',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />

        </apex:outputLink>
        </apex:outputPanel> <apex:actionStatus id="sortName">
        <apex:facet name="start">
        <span style="color: red;">Loading</span>
        <img src="{!URLFOR($Resource.ProgressIndicator)}" />
        </apex:facet>
        </apex:actionStatus></th>
        <th style="width: 14%;"><apex:outputPanel >
        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('PRIM_ADDR_LN_1');">Street Address <img
        src="{!IF(sortField = 'PRIM_ADDR_LN_1',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />
        </apex:outputLink>
        </apex:outputPanel></th>
        <th style="width: 14%;"><apex:outputPanel >
        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('PRIM_CITY');">City <img
        src="{!IF(sortField = 'PRIM_CITY',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />
        </apex:outputLink>
        </apex:outputPanel></th>
        <th style="width: 14%;"><apex:outputPanel >
        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('PRIM_STATE');"> State/Province <img
        src="{!IF(sortField = 'PRIM_STATE',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />
        </apex:outputLink>
        </apex:outputPanel></th>
        <th style="width: 14%;"><apex:outputPanel >

        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('PRIM_POSTAL_CD');"> Zip/Postal Code <img
        src="{!IF(sortField = 'PRIM_POSTAL_CD',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />
        </apex:outputLink>
        </apex:outputPanel></th>
        <th style="width: 14%;"><apex:outputPanel >

        <apex:outputLink value="javascript:void(0);" disabled="{!IF(searchCount > 0, false, true)}"
        onclick="sortAccountDataJS('PRIM_COUNTRY_NM');"> Country <img
        src="{!IF(sortField = 'PRIM_COUNTRY_NM',IF(isAsc = true,'/img/sort_asc_arrow.gif','/img/sort_desc_arrow.gif'),'/s.gif')}" />
        </apex:outputLink>
        </apex:outputPanel></th>
        <!--
        <th style="width: 14%;"><apex:outputPanel >

        Immediate Parent
        </apex:outputPanel></th>
        <th style="width: 14%;"><apex:outputPanel >

        Ultimate Parent
        </apex:outputPanel></th>
        -->
        </tr>


        <apex:repeat value="{!searchResults}" var="searchResultObj">
        <tr>
        <td><apex:outputPanel rendered="{!IF(hyperlinkMap[searchResultObj.ecId].isAccountExist=false,true,false)}">
        <apex:commandLink action="{!createCDMSObject}" value="Create" rendered="{!newAccountAccess}">
        <apex:param name="firstParam"
        value="{!searchResultObj.ecId}" />
        </apex:commandLink>
        </apex:outputPanel></td>
        <td>
        <div id="option-{!searchResultObj.ecId}"
        onclick="popup('acc-{!searchResultObj.ecId}');"
        style="cursor: pointer;">+</div>

        </td>
        <td><apex:image value="/img/samples/color_green.gif" width="{!searchResultObj.scoreWidth}" height="15"/><apex:image value="/img/samples/color_yellow.gif" width="{!50-searchResultObj.scoreWidth}" height="15"/></td>
        <td><apex:outputText rendered="{!IF(hyperlinkMap[searchResultObj.ecId].isAccountExist=true,true,false)}">
        <a href="/{!hyperlinkMap[searchResultObj.ecId].relatedSObject['id']}">{!searchResultObj.fullOrgName}</a>
        </apex:outputText> <apex:outputText rendered="{!IF(hyperlinkMap[searchResultObj.ecId].isAccountExist=false,true,false)}">{!searchResultObj.fullOrgName} </apex:outputText>
        </td>
        <td><apex:outputText value="{!searchResultObj.primaryAddr1}" />
        <br></br><apex:outputText value="{!searchResultObj.primaryAddr2}" />
        <br></br><apex:outputText value="{!searchResultObj.primaryAddr3}" />
        </td>
        <td><apex:outputText value="{!searchResultObj.primaryCity}" /></td>
        <td><apex:outputText value="{!searchResultObj.primaryState}" /></td>
        <td><apex:outputText value="{!searchResultObj.primaryZip}" /></td>
        <td><apex:outputText value="{!searchResultObj.primaryCountry}" /></td>
        <!--
        <td>
        <apex:outputText rendered="{!searchResultObj.ipsrc == 'SFDC'}">
        <a target="_blank" href="/{!searchResultObj.ipid}"><span style="color:red">{!searchResultObj.ipname}</span></a>
        </apex:outputText>
        <apex:outputText rendered="{!searchResultObj.ipsrc == 'CDM'}">
        <span style="color:black">{!searchResultObj.ipname}</span>
        </apex:outputText>
        </td>
        <td>
        <apex:outputText rendered="{!searchResultObj.upsrc == 'SFDC'}">
        <a target="_blank" href="/{!searchResultObj.upid}"><span style="color:red">{!searchResultObj.upname}</span></a>
        </apex:outputText>
        <apex:outputText rendered="{!searchResultObj.upsrc == 'CDM'}">
        <span style="color:black">{!searchResultObj.upname}</span>
        </apex:outputText>
        </td>
        -->
        </tr>
        <tr>
        <td style="border: 0px;padding:0px"></td>
        <td colspan="8" style="border: 0px;padding:0px">
        <div id="panel-{!searchResultObj.ecId}"
        style="display: none" class="">
        <div class="container">
        <ul class="tabs">
        <li id="tab1-{!searchResultObj.ecId}" class="tab-link current"
        data-tab="tab-1{!searchResultObj.ecId}"
        onClick="showTab('tab1-{!searchResultObj.ecId}');"
        style="width: 20%;"><b>Account Details</b></li>
        <li id="tab2-{!searchResultObj.ecId}" class="tab-link"
        data-tab="tab-2{!searchResultObj.ecId}"
        onClick="showTab('tab2-{!searchResultObj.ecId}'),searchContactResponse('{!searchResultObj.ecId}');"
        style="width: 20%;"><b>Contacts</b></li>

        <li id="tab3-{!searchResultObj.ecId}" class="tab-link"
        data-tab="tab-3{!searchResultObj.ecId}"
        onClick="showTab('tab3-{!searchResultObj.ecId}'),searchMarket('{!searchResultObj.ecId}');"
        style="width: 20%;"><b>Source Systems</b></li>

        </ul>
        <div id="tab-1{!searchResultObj.ecId}"
        class="tab-content current" style="height: 100px;overflow-y: scroll;">
        <div class="tabl">
        <table cellspacing='0' cellpadding='0' id='form_table'
        class='table01'>
        <tr>
        <td><b>Account Name </b></td>
        <td>{!searchResultObj.fullOrgName}</td>
        </tr>
        <tr>
        <td><b> Primary Address </b></td>
        <td>{!searchResultObj.primaryAddr1} <br />
        {!searchResultObj.primaryAddr3}</td>
        </tr>
        <tr>
        <td><b> City </b></td>
        <td>{!searchResultObj.primaryCity}</td>
        </tr>
        <tr>
        <td><b> Phone</b></td>
        <td>{!searchResultObj.primaryPhoneNumber}</td>
        </tr>
        <tr>
        <td><b> ECID</b></td>
        <td>{!searchResultObj.ecid}</td>
        </tr>
        </table>
        </div>
        </div>

        <div id="tab-3{!searchResultObj.ecId}" class="tab-content " style="height: 120px;overflow-y: scroll;">

        <!-- XREF Starts Here -->
        <apex:outputPanel id="MarketAccount">
        <table cellspacing='0' cellpadding='0' id='form_table'
        class='table01'>

        <tr>
        <th> Source System</th>
        <th> Source Id</th>
        <th> Market Outlet Code</th>
        </tr>
        <apex:repeat value="{!marketOuterMap[searchResultObj.ecId]}" var="marketOutletObj">
        <apex:repeat value="{!marketOutletObj}" var="key">
        <tr>
        <td>
        <apex:outputText >
        {!marketOuterMap[searchResultObj.ecId][marketOutletObj].sourceSystem}
        </apex:outputText> 
        </td>

        <td>{!marketOuterMap[searchResultObj.ecId][marketOutletObj].sourceSystemId} </td>

        <td>{!marketOuterMap[searchResultObj.ecId][marketOutletObj].marketOutletCode}</td> 
        </tr>
        </apex:repeat>
        </apex:repeat>  
        </table>
        </apex:outputPanel>

        <!-- XREF Ends Here-->

        </div>

        <div id="tab-2{!searchResultObj.ecId}" class="tab-content " style="height: 120px;overflow-y: scroll;">
        <apex:outputPanel id="contact">
        <table cellspacing='0' cellpadding='0' id='form_table'>
        <tr>
        <th><b> First Name  </b></th>
        <th><b> Last Name  </b></th>
        <th><b> ECID  </b></th>
        <th><b> Email  </b></th>
        <th><b> City  </b></th>
        </tr>
        <apex:repeat value="{!relatedSobject[searchResultObj.ecId]}" var="searchResultObj"> 

        <tr>
        <td>{!searchResultObj.firstName}</td>

        <td>{!searchResultObj.lastName}</td>

        <td>{!searchResultObj.ecId}</td>

        <td>{!searchResultObj.email}</td>

        <td>{!searchResultObj.primaryCity}</td>
        </tr>
        </apex:repeat>
        </table>
        </apex:outputPanel></div>
        <!--
        <script>alert('{!searchResultObj.ecId}');</script>
        <div id="tab-3{!searchResultObj.ecId}" class="tab-content ">
        Transaction Details
        </div>
        -->
        </div>

        </div>

        </td>
        </tr>
        </apex:repeat>

        </table>
        </apex:outputPanel>
        <apex:outputPanel id="footerPanel" rendered="{!NOT(searchCount==0)}">
        <hr />
        <table width="100%" border="0px" cellspacing="0px"
        cellpadding="0px">
        <tr>
        <td align="left" width="33%">
        <div id="pagelinkblock"><nobr> Show &nbsp; <apex:selectList value="{!maxRow}" size="1"
        onchange="document.getElementById('pg').scrollIntoView();showSearch();">
        <apex:selectOption itemLabel="10" itemvalue="10"></apex:selectOption>
        <apex:selectOption itemLabel="25" itemvalue="25"></apex:selectOption>
        <apex:selectOption itemLabel="50" itemvalue="50"></apex:selectOption>
        <apex:selectOption itemLabel="100" itemvalue="100"></apex:selectOption>
        <apex:selectOption itemLabel="200" itemvalue="200"></apex:selectOption>
        </apex:selectList>
        <div id="curstate"><nobr>Records per page:
        {!showingFrom} - {!showingTo} of &nbsp;
        <apex:outputText value="{0, number,###,###,##0}">
        <apex:param value="{!totalRecords}"/>
        </apex:outputText>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</nobr></div>
        </nobr></div>
        </td>
        <td align="center" width="33%" style="vertical-align: middle;">
        <nobr> <apex:outputLink value="javascript:void(0);"
        rendered="{!isPreviousPageAvailable}"
        onclick="previousAccountPage();">&lt;&lt;Previous
        </apex:outputLink> <span id="div_mid1">&nbsp; <apex:outputLabel value="|"
        rendered="{!isPreviousPageAvailable && isNextPageAvailable}" />&nbsp;
        </span> <apex:outputLink value="javascript:void(0);"
        rendered="{!isNextPageAvailable}" onclick="nextAccountPage();">Next&gt;&gt;</apex:outputLink>
        <apex:outputText >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </apex:outputText>
        <!-- <apex:outputLink value="javascript:void(0);"
        rendered="{!AND(totalPage==currentPage)}"
        onclick="fetchMoreSSCE();">Fetch More&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
        </apex:outputLink> --> </nobr></td>
        <td align="right" width="33%" style="vertical-align: middle;">
        <nobr>
        <div id="pagenumber"><nobr>Page &nbsp; <apex:inputText value="{!requestedPage}" style="width:40px" />of &nbsp;
        <apex:outputText value="{0, number,###,###,##0}">
        <apex:param value="{!totalPage}"/>
        </apex:outputText>

        <apex:actionStatus id="goStatus">
        <apex:facet name="start">
        <img src="{!URLFOR($Resource.ProgressIndicator)}" />
        </apex:facet>
        <apex:facet name="stop">
        <apex:commandButton value="Go" action="{!requestedPage}" oncomplete="document.getElementById('pg').scrollIntoView();" reRender="resultBlock,pnlDisplayMsg,resultTable,error,footerPanel" status="goStatus" rendered="{!IF(searchCount <= maxRow,false,true)}"/>     
        </apex:facet>
        </apex:actionStatus>

        </nobr>
        </div>
        </nobr></td>
        </tr>
        </table>
        </apex:outputPanel>
        <apex:outputPanel rendered="{!IF((searchTerm== '' && searchTerm == null ),false,true)}">
        <apex:outputText rendered="{!IF(searchResults.size = 0,true,false) }">No search results found for <b> {!searchTerm} </b></apex:outputText>
        </apex:outputPanel>
    </apex:pageBlock>   <!-- --- Result Page block End here ----->    

    </apex:pageBlock> <!-- --- Search Page block End here ----->    
    <apex:outputPanel id="createAccountPanel">
    <apex:pageBlock id="pb" title="Create Account" rendered="{!isShow}"> <!-- --- Create New Account Page block starts here ----->    
    <apex:pageMessages id="errormsg" />
    <apex:pageBlockSection columns="1" title="Account Details"
    collapsible="false">
    <apex:inputText style="width: 561px;"  value="{!editExtObj.currentSObject['Name']}"  />
    <!--Start Change Added for Case#1396391 -->                
    <apex:inputField style="width: 561px;"  value="{!editExtObj.currentSObject['Account_Acronym__c']}"/>
    <!--End Change -->                  
    <apex:inputField style="width: 561px;"  value="{!editExtObj.currentSObject['ParentId']}"/>
    <!--  <apex:inputText value="{!editExtObj.currentSObject['Phone']}" />-->
    <apex:selectList value="{!selectedRecordType}" size="1" label="Record Type" style="width: 173px;" >
    <apex:selectOptions value="{!recordTypes}" />
    <apex:actionSupport action="{!fillTier1Classification}" oncomplete="setTierClassification();" status="LargeStatus" event="onchange" reRender="tier1classification,acctType,acctTypeLabel"/>
    </apex:selectList>
    <apex:pageBlockSectionItem > 
    <apex:outputLabel >Tier 1 Classification</apex:outputLabel>
    <apex:outputPanel id="tier1classification">
    <apex:inputField styleClass="Tier_1_Classification"  value="{!tierAccount.Tier_1_Classification__c}" label="Tier 1 Classification" rendered="{!IF(selectedRecordType!='',true,false)}" />                        
    <apex:selectList label="Tier 1 Classification" size="1" multiselect="false" rendered="{!IF(selectedRecordType='',true,false)}">
    </apex:selectList>
    </apex:outputPanel>
    </apex:pageBlockSectionItem>
    <apex:outputText rendered="{!isCDMSObject}"
    value="{!editExtObj.currentSObject['ECID__c']}" />
    <c:PhoneValidation PhoneWrap="{!accountPhone}" />

    <apex:pageBlockSectionItem > 
    <apex:outputPanel id="acctTypeLabel">
    <apex:outputLabel rendered="{!selectedRecordType=='012d0000000xGxuAAE'}">Type</apex:outputLabel>
    </apex:outputPanel>
    <apex:outputPanel id="acctType">
    <apex:selectList value="{!selectedType}" size="1" style="width: 173px;" rendered="{!selectedRecordType=='012d0000000xGxuAAE'}">
    <apex:selectOptions value="{!AccountTypes}" />
    </apex:selectList>
    </apex:outputPanel>
    </apex:pageBlockSectionItem>



    <apex:inputField style="width: 561px;"  value="{!editExtObj.currentSObject['Website']}"/>

    </apex:pageBlockSection>
    <c:GoogleAddressValidation />
    <apex:actionRegion >
    <c:PrimaryAddress id="pcom"
    PriForceValidation="{!editExtObj.isPrimaryForceValidation}" addressWrapper="{!editExtObj.primaryAddressWrapper}" />
    </apex:actionRegion>
    <c:AdditionalAddresses id="acom"
    AddiForceValidation="{!editExtObj.isAdditionalForceValidation}" addressWrapper="{!editExtObj.additionalAddressObj}" />
    <apex:actionStatus id="AccountStatus">
    <apex:facet name="start">

    <img src="{!URLFOR($Resource.ProgressIndicator)}" />
    </apex:facet>
    <apex:facet name="stop">
    <apex:actionRegion >
    <apex:commandButton action="{!previousSearchResult}" oncomplete="document.getElementById('pg').scrollIntoView();"  style="margin-left: 15px;" status="AccountStatus" value="Search Result" reRender="mainOutputPanel"/>
    </apex:actionRegion>
    </apex:facet>
    </apex:actionStatus>

    <apex:actionStatus id="SaveStatus">
    <apex:facet name="start">
    <img src="{!URLFOR($Resource.ProgressIndicator)}" />
    </apex:facet>
    <apex:facet name="stop">
    <apex:actionRegion >
    <input type="button" style="width: 5%;" class="btn" value="Save" onclick="Save();"/>
    </apex:actionRegion>
    </apex:facet>
    </apex:actionStatus>


    <apex:actionFunction name="Save" action="{!dosave}" reRender="frm,errorPanel" oncomplete="document.getElementById('pg').scrollIntoView();" status="SaveStatus"/>
    </apex:pageBlock>  <!-- --- Create New Account Page block End here ----->    
    </apex:outputPanel>
</apex:outputPanel>   
<!-- mainOutputPanel -->
</apex:form>
  • 2
    Thanks for these ~550 lines of code...but surely not all of them are relevant? – Adrian Larson Apr 26 '17 at 15:54
  • Why i pasted everything is , inputtext is inside many panels and page blocks thats y. I need to set null to this elelmnt, <apex:inputText value="{!a.SearchValue}" id="searchTextId"/> – ram135868 Apr 26 '17 at 15:58
  • 3
    If you can't isolate the problem to a few dozen lines of code at most, what makes you think strangers on the internet are going to do it for you? – Adrian Larson Apr 26 '17 at 16:00
1

You can generally accomplish this with a css selector. You can either search for all elements with ids containing your textboxes' ID, or add a class to the textboxes to search for:

textarea[id*='searchTextId']

.searchTextClass

Then just use document.querySelectorAll to get a collection of all the text boxes and clear them:

var boxes = document.querySelectorAll('textarea[id*="searchTextId"]');
for(var i = 0; i < boxes.length; ++i)
{
    boxes[i].value = '';
}
| improve this answer | |

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.