Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-02 13:58:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

search textpattern sites - javascript help needed

I am experimenting with some javascript hacked from various sources which will allow users to search various txp, wiki and punBB installs using one search field and a pull down menu.

I am developing this for my sites but I hope that there will be interest.

the current state can be found on http://www.neme.org/search.html

the form in its current state (semi)works but I have still to solve the following problems

  • Validation: Even in its most simple form I just can’t validate it: http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.neme.org%2Fsearch.html
  • When the enter or the return key is pressed I get no results.

Any help from more experienced javascript users out there will be appreciated


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2008-01-02 14:08:52

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: search textpattern sites - javascript help needed

To search for main site use http://textpattern.com/search?q=case instead of http://textpattern.com/?q=case ;)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#3 2008-01-02 14:59:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: search textpattern sites - javascript help needed

thanks victor

the problem of the validation and the return key still remains


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2008-01-02 22:16:04

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: search textpattern sites - javascript help needed

I think validation errors are because of doctype. try to play with setting doctype to different values


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#5 2008-01-02 22:32:37

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: search textpattern sites - javascript help needed

Or better: fix the validation errors.

lowercase onload:

<body onload="addOptions()">

javascript in CDATA tag:

<script type="text/javascript">
/* <![CDATA[ */
// content of your Javascript goes here
/* ]]> */
</script>

And in URLs, replace all raw & with &amp;

Offline

#6 2008-01-03 08:03:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: search textpattern sites - javascript help needed

Thanks ruud

The little engine is getting there:)

Unfortunately I cannot replace the raw & with &amp; as the punbb forums do not recognise it.
I have uploaded the latest version within which I included the ‘correctly’ encoded punBB search url so as to demonstrate.
As the url resides in the javascript though, the validator does not seem to pick it up as an error.

At the moment there’s just one problem which is that I just can’t make the keys to work. That is, if a word is typed and then either the ‘enter’ or the ‘return’ key is hit, the form is just not parsed properly.
Any suggestions?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2008-01-04 06:41:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: search textpattern sites - javascript help needed

anyone?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2008-01-04 20:16:47

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 299
Website GitHub Twitter

Re: search textpattern sites - javascript help needed

Hello Yiannis

I came across this thread which looks like it might be useful for your amp problem:

…what you want is %26, which is the URL-encoded hexadecimal escaped value for the ampersand; not &amp;, which is the HTML named, character entity…

Offline

Board footer

Powered by FluxBB