So if you could actually provide the HTML that the javascript would run in so 
that we could fire it to debug it that would help. That's why I mentioned 
making the HTML doc as well as javascript code.

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Paul Noone
Sent: Friday, 20 March 2009 12:41 PM
To: ozmoss@ozmoss.com
Subject: RE: Multiple search scopes error [SEC=UNCLASSIFIED]

Thanks, Jeremy, that's a useful resource.

What I really meant though is that I need help with the actual JavaScript, not 
the debugging. I was hoping someone familiar with the dreaded language could 
get the code working. So far it's just theory bundled together from other 
sources and modified a little by me.

Regards,

Paul
Online Developer, ICT
CEO Sydney
From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Jeremy Thake
Sent: Friday, 20 March 2009 1:56 PM
To: ozmoss@ozmoss.com
Subject: RE: Multiple search scopes error [SEC=UNCLASSIFIED]

I would recommend creating a blank HTML document and having some input controls 
on there to mimic whatever interface you finally want to get this into.

Then put the javascript on the page.

This gives you a controlled environment where you are dealing with just getting 
the javascript working. Then you can put this working code onto the SharePoint 
page and open it to other elements that *might* be breaking the code.

I would also recommend using some JavaScript debugging tools to allow you to 
step through the code to see how you're going.

There are references to JavaScript debugging tools here:
http://sharepointdevwiki.com/display/public/JavaScript+debugging+tools
be interested to see what others use for JavaScript e.g. to fill this page out 
some more ;-)

From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Paul Noone
Sent: Friday, 20 March 2009 11:06 AM
To: ozmoss@ozmoss.com
Subject: RE: Multiple search scopes error [SEC=UNCLASSIFIED]

I have some barebones functions to manage this but require some help. Any 
JavaScript gurus out there?

I have created a couple of functions. One scours the page for all inputs of 
type checkbox and then adds an onclick event on the fly.

The second is the function which checks the state of the checkboxes and applies 
checked=true to the selection (if it is not already checked) and then unchecks 
all other checkboxes.

I'm having trouble however and am hoping someone is able to provide the 
solution. :)

// Only allow one checkbox at a time to be checked
function CheckCheckboxes(){
          var foundCount = 0
          for(i=0;i<document.getElementsByTagName("input").length;i++)
          {
                   if(document.getElementsByTagName("input")[i].type == 
"checkbox")
                   {
                   //alert(document.getElementsByTagName("input")[i].checked)
                             
if(document.getElementsByTagName("input")[i].checked == true)
                             {
                                      // Do something
                             }
                             else if (type=="checkbox")
                             {
                                      // Do something else
                             }
                             foundCount++
                   }
          }
}

// Add the onclick event at run-time
var allCheckboxes = document.getElementsByTagName("input").type == "Checkbox";
for (i=0;i<allCheckboxes.length;i++) {
          allCheckboxes[i].onclick=function() {return CheckCheckboxes(this)};
}

// Activate the functions on page load
if( window.onload )
{
  CheckCheckboxes();
}
From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Paul Noone
Sent: Thursday, 19 March 2009 11:54 AM
To: ozmoss@ozmoss.com
Subject: RE: Multiple search scopes error [SEC=UNCLASSIFIED]

By default the All Sites scope includes All Content. The problem arises if you 
add exclusions (URL matches) to this and select another scope.

I'd like to restrict them to single scope searches if possible but this isn't 
as easy as I'd hoped.

Regards,

Paul
Online Developer, ICT
CEO Sydney
From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Noja, Fadi
Sent: Thursday, 19 March 2009 10:26 AM
To: ozmoss@ozmoss.com
Subject: RE: Multiple search scopes error [SEC=UNCLASSIFIED]

Have you tried using different Content Sources for the search and each one only 
having one scope?  Do you want to give them the option of choosing more than 
one scope?

________________________________
From: ozmoss@ozmoss.com [mailto:ozm...@ozmoss.com] On Behalf Of Paul Noone
Sent: Thursday, 19 March 2009 9:41 AM
To: ozmoss@ozmoss.com
Subject: Multiple search scopes error

Hi guys,

I've run into a typical end user problem. Because the Advanced Search web part 
allows them to pick multiple scopes they tend to select them all, just to be 
safe, even though one of them is called "All Sites"!

In doing so, they receive the error:

"Your search cannot be completed because of a service error. Try your search 
again or contact your administrator for more information."

I know why this is happening 
[http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/fb78decc-aeb5-4c04-bb75-473c25f8c11d/]
 but am not sure of the best approach to rectify it.

I'd originally added some JavaScript to the page via a CEWP to uncheck the 
selected scope when another selection was made but this wasn't ideal.

Aside from educating end users, are there any other suggestions?

Kind regards,

Paul Noone
Online Developer, ICT
CEO Sydney

ph: (02) 9568 8461
fax: (02) 9568 8483
email: 
paul.no...@ceo.syd.catholic.edu.au<mailto:paul.no...@ceo.syd.catholic.eduau>
web: http://www.ceo.syd.catholic.edu.au/

________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.19/2010 - Release Date: 03/19/09 
19:03:00

________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
Support procedure: https://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.238 / Virus Database: 270.11.19/2010 - Release Date: 03/19/09 
19:03:00
--------------------------------------------------------------------------------
Support procedure: http://www.codify.com/lists/support
List address: ozmoss@ozmoss.com
Subscribe: ozmoss-subscr...@ozmoss.com
Unsubscribe: ozmoss-unsubscr...@ozmoss.com
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists

Reply via email to