Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Simple page search module?Simple page search module?
Previous
 
Next
New Post
3/26/2013 12:33 PM
 

I'm looking for a page search module that will function the same as ctrl+f.  The search module just needs to search the page and highlight the term entered.  It sounds simple to code.  I have found many html codes, but have no idea how to get the actual search function to work.

 
New Post
3/26/2013 12:34 PM
 
I have not seen any module out on the market that can handle this type of thing. It would be fairly easy to handle this, at least at a basic level with a bit of javascript and some custom CSS.

-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
3/26/2013 2:31 PM
 
I have a little bit of knowledge with html and css. If I have these 2 codes, how do I compile them or have the html code call upon the javascript code?

html search box: http://support.google.com/customsearch/bin/answer.py?hl=en&answer=1351747

/* javascript search function from http://www.javascripter.net/faq/searchin.htm */
var TRange=null;

function findString (str) {
if (parseInt(navigator.appVersion)<4) return;
var strFound;
if (window.find) {

// CODE FOR BROWSERS THAT SUPPORT window.find

strFound=self.find(str);
if (!strFound) {
strFound=self.find(str,0,1);
while (self.find(str,0,1)) continue;
}
}
else if (navigator.appName.indexOf("Microsoft")!=-1) {

// EXPLORER-SPECIFIC CODE

if (TRange!=null) {
TRange.collapse(false);
strFound=TRange.findText(str);
if (strFound) TRange.select();
}
if (TRange==null || strFound==0) {
TRange=self.document.body.createTextRange();
strFound=TRange.findText(str);
if (strFound) TRange.select();
}
}
else if (navigator.appName=="Opera") {
Opera browsers not supported, sorry...")
return;
}
if (!strFound) String '"+str+"' not found!")
return;
}




 
New Post
3/26/2013 4:41 PM
 
I put the above javascript source code into the Header section of the dnn HTML module and used the following html code (not closed):

 

Code:
<html>

    <head>
    </head>
    <body>
        <input type="text" id="t1" name="t1" size="20" onkeydown=" if(event.keycode==13){if(t1.value!='')parent.findString(t1.value);return(false);}" /><input type="button" name="b1" value="Find" onclick=" if(t1.value!='')parent.findString(t1.value);return(false);" />
    </body>
</html>

      

This works fine, but it also searches the search box itself, meaning it will not alert the user that the term was not found. Also, how do I make it run the function after hitting enter? I would also like to keep the onclick.

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Simple page search module?Simple page search module?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out