Jump to content
  • 0
Sign in to follow this  
hrdickinson

Virtual Fields as Search Criteria

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.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...