MARATHI TEAM
Welcome on the Marathi Team Forum.
To take full advantage of everything offered by
our forum, please log in if you are already a
member or join our community if you're not
yet....


Join the forum, it's quick and easy

MARATHI TEAM
Welcome on the Marathi Team Forum.
To take full advantage of everything offered by
our forum, please log in if you are already a
member or join our community if you're not
yet....
MARATHI TEAM
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password

Latest topics
Top posting users this week
No user

Nimbuzz id Maker
freebuzz is my love :D

user name

password

captcha


Search box to find texts on the pages

Go down

Heart Search box to find texts on the pages

Post  storm Thu Dec 13, 2012 2:21 am

This Code gives you a text box and if the user wants to search for anything they just need to put their keywords in the box and this code immediately finds the keyword that the user is looking for

Code:
<!-- This Script is from www.htmlfreecodes.com, Coded by: Krishna Eydat-->
<SCRIPT language=JavaScript>
var NS4 = (document.layers);   
var IE4 = (document.all);
var win = window;   
var n  = 0;
function findInPage(str) {
  var txt, i, found;
  if (str == "")
    return false;
  if (NS4) {
    if (!win.find(str))
      while(win.find(str, false, true))
        n++;
    else
      n++;
    if (n == 0)
      alert("Not found.");
  }
  if (IE4) {
    txt = win.document.body.createTextRange();
    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }
    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      n++;
    }
    else {
      if (n > 0) {
        n = 0;
        findInPage(str);
      }
      else
        alert("Sorry, we couldn't find.Try again");
  }
  }
  return false;
}
</SCRIPT>

<FORM name=search onsubmit="return findInPage(this.string.value);">
<P align=center><FONT size=3>
<INPUT
style="BORDER-RIGHT: #666666 1px solid; BORDER-TOP: #666666 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #666666 1px solid; BORDER-BOTTOM: #666666 1px solid"
onchange="n = 0;" size=16 name=string></FONT><BR><INPUT style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; FONT-SIZE: 8pt; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 1px solid; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #aaaaaa" type=submit value=Search in page ><center><font size=2pt;><font family=Times New Roman;><b>

<font face="Tahoma"><a target="_blank" href="http://www.htmlfreecodes.com/"><span style="font-size: 8pt; text-decoration: none">HTML Free Code</span></a></font>
storm
storm
Member
Member

Posts : 155
Points : 458
Reputation : 1
Join date : 2012-12-05

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum