Author Topic: Changing Default options for search and select prompt  (Read 6668 times)

Offline cusacjl

  • Associate
  • **
  • Posts: 4
  • Forum Citizenship: +1/-0
Changing Default options for search and select prompt
« on: 11 Oct 2006 03:57:38 pm »
When you run a report with a search and select prompt, the default selection is "starts with any of these keywords".  What I want to do is when you run the report, the default selection is "contains any of these keywords".  This would eliminate the user from having to open "options" to change it. 

If any one has an idea on how to accomplish this, please let me know.

Thanks.

Offline tyody

  • Full Member
  • ***
  • Posts: 13
  • Forum Citizenship: +0/-0
Re: Changing Default options for search and select prompt
« Reply #1 on: 20 Oct 2006 08:25:25 am »
I am having the same issue.  I've tried using the following javascript in an HTML item but for some reason its not working.  Feel free to try it to see if it works for you:

<script>
searchUID.setOptions('on', 'off');
</script>

(Where UID is the ID of the search and select prompt).

Offline cusacjl

  • Associate
  • **
  • Posts: 4
  • Forum Citizenship: +1/-0
Re: Changing Default options for search and select prompt
« Reply #2 on: 20 Oct 2006 09:02:27 am »
Send me an email and I will give you the answer to the problem.  However, I've been warned that this solution/trick is not 'upgradeable' to C8.  Because of that, I am not planning on using the solution, but you're more than welcome to it.

John
johnlcusack@eaton.com

Offline crossjoin

  • Full Member
  • ***
  • Posts: 6
  • Forum Citizenship: +1/-1
Re: Changing Default options for search and select prompt
« Reply #3 on: 24 Oct 2006 03:07:38 am »
I've been using this:
Code: [Select]
<SCRIPT language="javascript">

        searchFOO.setOptions('on', 'on');

</SCRIPT>

Where FOO is the ID of the search and select prompt.
wfm

Darek

  • Guest
Re: Changing Default options for search and select prompt
« Reply #4 on: 06 Dec 2006 04:48:17 am »
Check my article on SupportLink. It should give you a good idea on how to develop an "upgradeable" solution.

But, I understand that you might be time pressed, so ..., alternatively you may put this piece of code as an HTML Item somehwere towards the end of page.

Code: [Select]
<script language="JavaScript">

for( var i=0; i<preProcessControlArray.length; i++){

 var cntlName = eval(preProcessControlArray[i]);

 if ( cntlName.m_oSubmit.name == 'p_First name' ){

  var s = new String(cntlName.m_sRef);

  var oIdAdvancedOptions = document.getElementById("idAdvancedOptions"+s);

  var oimgAdvancedArrow = document.getElementById("imgAdvancedArrow"+s);

  var oIdSelections = document.getElementsByName("swsOption"+s);

  oIdAdvancedOptions.style.display = "inline";

  oimgAdvancedArrow.src = "../skins/current/prompting/images/prompt_option_collapse.gif";

  if (cntlName.m_oShowOptions)

  {

    cntlName.m_oShowOptions.value="true";

  }

  oIdSelections[2].checked="1";

  cntlName.setOptions('on','off');

  break;

 }

}

</script>

Enjoy!

Offline trooper642

  • Full Member
  • ***
  • Posts: 8
  • Forum Citizenship: +0/-0
Re: Changing Default options for search and select prompt
« Reply #5 on: 15 Jan 2008 07:45:31 am »
I’m using the code below to change the default option to “Contains Any” the code selects the correct option but when clicking Search it returns the results of “Starts with”. But if I delete the code and select “Contains Any” manually the Search works correctly. I have the code in an HTML Item right after the Select & Search Prompt.

I’m running ver 8.1
ID = SSP

<script language="javascript">
document.all.swsMatchAny.checked="true";
searchSSP.setOptions('on', 'on');
</script>

-Bryan

Offline jrun

  • Associate
  • **
  • Posts: 1
  • Forum Citizenship: +0/-0
Re: Changing Default options for search and select prompt
« Reply #6 on: 27 Jan 2008 07:06:17 pm »
Hi guys,

I had the same problem of Bryan. Darek can you explain why ? Maybe something is missing in your code.

jrun

Offline trooper642

  • Full Member
  • ***
  • Posts: 8
  • Forum Citizenship: +0/-0
Re: Changing Default options for search and select prompt
« Reply #7 on: 12 Jun 2008 11:59:11 am »
This code will change the default option to "Contains any of these keywords" and "SSP" is the name of the Search and Select Object.

<html>
<script type="text/javascript">
<!--
//resize SSP (InternalClientNo prompt)
document.forms("formWarpRequest")._sws_SSP_matchAnywhere.value= 'true';
document.forms("formWarpRequest")._sws_SSP_matchAll.value= 'false';
document.forms("formWarpRequest").swsOptionSSP(2).checked=true;
// -->
</script>
</html>


-Bryan

Offline Lorilie10

  • Associate
  • **
  • Posts: 1
  • Forum Citizenship: +0/-0
Re: Changing Default options for search and select prompt
« Reply #8 on: 30 Jul 2009 11:06:47 pm »
What is the easiest way to change the default options for search and select prompt? Can you share it to me?




_________________
offshore staffing solutions