Jump to content
  • 0

Clearing Parameters From A Submission Form


JEllington

Question

Hello, I have created a search data page similar to the example shown in http://howto.caspio.com/tech-tips-and-articles/parameters/add-a-search-interface-to-results-sets-page/
 
The search works fine the first time around (sometimes on a clean page load), but if you search again the search and appsession parameter from the previous search are still shown cached in the browser. Manually deleting these from the browser URL Bar allows for a successful search.
 
From within the search form, I tried setting the destination to the same page and used the same search page url (http://www.mydomain.com/searchpage.html?cbResetParam=1). But apparently this clears the search parameter before the results data page can receive them.
 
My question is where do I insert the cbResetParam=1 reset parameter to reset the browser cache when a new search is submitted from the submission form?
I am guessing it could be reset "onclick" using js in the footer, but alas I am still learning js and could not find any examples to get started on
Thank you in advance for any help on this.
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Thank you for your response aam82, 
apologies for my misunderstanding, are you saying that the /?cbResetParam=1 should be placed in the deploy code?  if so where..

(embeded deploy code)

<script type="text/javascript" src="https://b4.caspio.com/scripts/e1.js"></script>
<script type="text/javascript">try{f_cbload("d6a92000027da889d37346a780a1","https:");}catch(v_e){;}</script>
<div id="cxkg"><a href="https://b4.caspio.com/dp.asp?AppKey=d6a92000027da889d37346a780a1">Click here</a> to load this Caspio <a href="http://www.caspio.com" target="_blank" title="Cloud Database">Cloud Database</a></div>
Link to comment
Share on other sites

  • 0

JE, you would deploy as usual:

domain.com/searchform

  paste your deploy code

 

Then, in your site menu, add the reset param to the link to that page:

Menu:

  Stuff

    SearchForm (url=domain.com/searchform/?cbResetParam=1)

 

Think of it like this: parameters in the URL are pulled in to your page. In this case, Caspio datapages find that parameter and use it to clear cached values. The datapage does the work, not the parameter.

Link to comment
Share on other sites

  • 0

I guess its more complicated than I originally explained.

I actually have 2 search and results html pages. The first search and results page (residing in locations.html) searches customer locations and displays them in a results tabular report. Within that results data page I have a html block that links to a 2nd search and results page using the relative link of <a href="invoices.html?cbResetParam=1&cid=[@field:Customer_ID]">View Invoices</a>

 

When the 2nd search and results (invoices.html) page loads the results data page shows the proper list of invoices for the passed "cid", but if you run another search from the Invoices.html search and results page the browser URL Bar shows the previous search from the cached previous session.

I can manually change the "cid=" parameter to another customer number within the URL Bar and the results data page displays the results properly but the "appSession=545~~" parameter just continues to grow in the URL Bar.
As you can see from my example I have tried the cbResetParam=1 in different locations (before the parameter with a ? and after the parameter with a &, in all links to and within the 2nd search and results page and unfortunately have not found the proper place to insert the cbResetParam=1. 

 

This is why I was thinking  a java script "onclick cbResetParam=1" function within the search form on  the 2nd search and results page would be the solution. Unfortunately I dont know JS well enough to write the proper function.

 

As a last resort I could just remove the search data page from the 2nd (invoices.html) page and make the user click a back button to start the search all over again from the location.html, but the extra user interaction required is far from desirable 

Link to comment
Share on other sites

  • 0

after thinking about it I am just going to display both results pages (locations and invoices) on the 1st search and results page and hide and unhide the invoice results form when the user clicks on the "show invoices" link.  This will also free up a data page by not having to use the 2nd search form.

Although I would still like to know the solution to resetting a 2nd search form for future reference.

Thanks for your insight on resolving this aam86.

Link to comment
Share on other sites

  • 0

This seemed to work for me.

After messing around with it a bit.

 

The trick in the submit form , the destination , do not use "Same Form" opton

Use "Go to New Page" and enter the URL of the results datapage

 

Also..

In the Submit form

----------------------
add < ahref="url?cbResetParam=1 > New Search</a> in Header
destination : url of results page ( do not use "same Form" option !!)
in dropdowns , make sure the onload external parameters is checked and entered.
This will keep the drop downs in place after every submission.
 
 
results page
do not add search form links in results and details wizard options, leave it blank
Link to comment
Share on other sites

  • 0
16 hours ago, pmcfarlain said:

Having a similar issue and the /?cbResetParam=1 doesn't seem to be working. Is there another fix?

how are you passing the parameters? if you are currently passing the parameters when you click the link (for example On Exit), it will only reset the old parameter values, not the one that is currently being passed

Link to comment
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...
×
×
  • Create New...