Jump to content
  • 0
Sign in to follow this  
freshstart

Displaying Parameters

Question

I have 2 data pages. 1 is a submission form and the other is a results page. I am passing parameters from the submission form so that the results page finds the correct information from the database for display.

 

My database records have several fields, but for the purpose of this question I will only use 3 of the fields.

 

Field 1: Store Name

Field 2: Category

Field 3: State

 

Some of the stores are located in multiple states. Many are in all 50 states.

Rather than creating a separate record for each store/category/state I have put all states for that store name into the state field, with each separated by a comma.

 

 When I submit my search using a "contains" format I have no problem finding each record that I am searching for, but I don't want to display all of the text that can be found in the state field, I only want to display the parameter that was passed when I ran the search.

 

Is there any way to display the parameter on my results page and not the actual text found in the state field?

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Hi, to display the parameter you can input the parameter in the Header/Footer or HTML block which repeats for each record. For example if the parameter passed from submission/search is called [@state] you can receive it in the HTML block same [@state]. Does this help?

Share this post


Link to post
Share on other sites
  • 0

Thanks so much. I used the html block and it worked great except for 1 thing. I have my dropdown lists setup to allow "All" to be selected. When "All" is selected I cannot get the word "All" to show up using html, it just gives me a blank. I am assuming it is because no value is assigned to this option. Any suggestions?

Share this post


Link to post
Share on other sites
  • 0

Hello freshstart,

 

If I understand correctly, you can use a JavaScript code to pass the value of the selected item.

 

Please follow the next steps:

Add a Virtual field to your Submission form, and then select Hidden in the Foem element dropdown;

Pass the value of this Hidden Virtual filed as parameter;

Add the Header&Footer element to your Submission form and enter the following code to the Footer:

<SCRIPT LANGUAGE="JavaScript">
function insert_parameter()
{
var selected = document.getElementById("InsertRecordDROPDOWN");
var value_parameter = selected.options[selected.selectedIndex].text;
document.getElementById("cbParamVirtual1").value = value_parameter;
}
document.getElementById("caspioform").onsubmit=insert_parameter;
</SCRIPT>

Please enter the name of your field instead of DROPDOWN in the InsertRecordDROPDOWN.

If the name of your Hidden Virtual field is not Virtual1, then enter the number of your Virtual field instead of 1 in cbParamVirtual1.

 

On the Report DataPage use the passed parameter in your HTML block.
 
I hope it helps. 

Share this post


Link to post
Share on other sites
  • 0

I don't think this is what I need, although I may not be explaining my problem clearly.

 

I am using virtual fields to pass the parameters from my submission form dropdowns to my results page. I am using html to show the parameter being passed. It is working fine unless the selection is "All".

 

When I set up my dropdowns in the submission form I use a lookup table and also a custom value set to "All" with no value so that users can select this option and see all records. Since the "All" option has no value there is no value being passed when this option is selected.

 

I would like to display the word "All" on my results page when and only when the user selects "All" from my dropdown on the submission form. Any other selection is passing the parameter and displaying it perfectly.

 

Is it possible to use an "if" statement to assign a value when no value is passed? If so how would I do that? I don't know anything about javascript and very little about html.

 

Thanks, I appreciate your help.

Share this post


Link to post
Share on other sites
  • 0

I don't think this is what I need, although I may not be explaining my problem clearly.

 

I am using virtual fields to pass the parameters from my submission form dropdowns to my results page. I am using html to show the parameter being passed. It is working fine unless the selection is "All".

 

When I set up my dropdowns in the submission form I use a lookup table and also a custom value set to "All" with no value so that users can select this option and see all records. Since the "All" option has no value there is no value being passed when this option is selected.

 

I would like to display the word "All" on my results page when and only when the user selects "All" from my dropdown on the submission form. Any other selection is passing the parameter and displaying it perfectly.

 

Is it possible to use an "if" statement to assign a value when no value is passed? If so how would I do that? I don't know anything about javascript and very little about html.

 

Thanks, I appreciate your help.

Share this post


Link to post
Share on other sites
  • 0

Hello freshstart,

 

As far as I know, you cannot use "if" on the Report page to check whether the parameter is empty. I tried several ways, but they all failed.

And you should pass the empty parameter to find all values, so, I think, the best way is to use two parameters: one will be used in the search and the second will be displayed in the HTML block.

 

Also, you can display a Search Interface and a Results Set page on the one page.

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...