Jump to content
  • 0

Virtual Fields as Search Criteria


hrdickinson

Question

Is it possible to use virtual fields as search criteria?

I have a report datapage with an actual search field named "Client_ID".  That field is "Hidden".  I also have two virtual fields, each with a different multi-select listbox.  The virtual fields are both labeled "Client ID" and the one that gets displayed for the user to select from depends on the contents of an auth field (using a rule).

I want the selections from the virtual field that is displayed to be used as the actual "Client_ID" selections in the search.

The code I currently have in the footer (that doesn't work) is:

<script>

function setSearch(){

if("[@authfield:Level#]" == 3){

         document.getElementById("@field:Client_ID").value=document.getElementById("cbParamVirtual1").value;

}

else
{
         document.getElementById("@field:Client_ID").value=document.getElementById("cbParamVirtual2").value;

}
}

document.getElementById("caspioform").onsubmit = setSearch;
</script>
 

Is what I'm looking to do even possible?  I know I can have a separate search form and report datapage but I would prefer not to do that if possible.

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Hi hrdickinson,

 

You need to check the exact id name assigned to the Client_ID field.  In the Search form of a Report Datapage, a field can be assigned with id like
"Value3_1".  Do you have a sample Datapage?

Try this:
 

<script>

function setSearch(){

     if("[@authfield:Level#]" == 3){

             document.getElementById('ValueX_X').value=document.getElementById('cbParamVirtual1').value;

            }

    else
            {
             document.getElementById('ValueX_X').value=document.getElementById('cbParamVirtual2').value;

             }
}

document.getElementById("searchID").onmouseover = setSearch;

</script>

 

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...