Hi John,
I took a quick look at it and it looks like there are
several problems:
1) you need the submit button specified so they know
which search you are doing because the search wizard
doesn't add the submit buttons. For example for
iisfaq:
<input type="hidden" name="_ctl4:SearchGo"
value="Search" />
2) __VIEWSTATE needs to be set to a valid value and
this is similar to what I've been running into. A lot
of web sites now are setting up "sessions"
(__VIEWSTATE is the session id in this case) and if
there is no session for you (ie the form submit is the
thing you do) it fails. So you need to open the
search page first and then submit it all in the same
context (so cookies will be propagated). I've been
wrestling with how to a hit a webpage first to setup
the session (usually requiring cookies) and then
submitting the form - I haven't figured out a way to
do this yet. Anyone have any ideas?
3) in your parseArgs switch statement instead of case
"a" it needs to be case "articles". The parseArgs
expands it to the full argument name specified in the
list of arguments.
Good luck,
Brent
--- "John W. Bairen, Jr." <[EMAIL PROTECTED]> wrote:
> Hey guys. I started to write a search for
> www.iisfaq.com but I am having
> trouble getting it to submit the form. Attached is
> the xml file. It has
> been too long since I've written a search. Can
> anyone help finish this one
> up, please?
>
>
>
>
>
> Thanks,
> JB
>
>
> John W. Bairen, Jr.
> www.bairen.net
>
> > <search function="iisfaq">
> <COMMENT>
>
> Even though this XML search will probably load
> and is a good start
> toward a completed search, please be aware that
> this search will probably
> not work as is and will probably require some
> changes.
>
> </COMMENT>
> <name>IISFAQ</name>
> <category>Computers
> <category>Reference</category></category>
> <contributor>John W. Bairen, Jr.</contributor>
> <link>http://www.iisfaq.com/</link>
> <email>john_at_bairen_dot_net</email>
> <description>
> Search IISFAQ - "Your best resource to help you
> Install, Configure &amp; Troubleshoot IIS".
> <div class="helpboxDescLabels">Switches:</div>
> <table class="helpboxDescTable">
> <tr><td>/a - Articles</td><td> -
> </td><td></td></tr>
> </table>
> <div class="helpboxDescLabels">Examples:</div>
> <table class="helpboxDescTable">
> <tr><td></td></tr>
> <tr><td></td></tr>
> </table>
> </description>
> <form name="iisfaqf"
> method="post"
> action="http://www.iisfaq.com/Default.aspx">
> <COMMENT> The following field was active
> (i.e. had focus) when the search was generated.
> </COMMENT>
>
> <input type="hidden" name="_ctl3:Search"
> value="" />
> <input type="hidden" name="_ctl3:JumpToArticle"
> value="" />
> </form>
> <script><![CDATA[
> function iisfaq(q)
> {
> if( nullArgs("iisfaq", q) )
> return;
>
> // Parse switches with parseArgs:
>
> // parseArgs usage:
> // Arguments:
> // q - string from the
> search function
> // expectedSwitches - list or array of the
> expected switch values
> // expandSwitches - optional parameter
> [default = true] used to determine
> // if the switch
> shortcuts should be expanded (i.e. /f becomes /foo)
> // Returns an object with these properties:
> // q - the input string with the
> switches removed
> // switches - array of objects with these
> two properties:
> // name: expanded name of
> the matched switch (i.e. foo as in /foo:bar)
> // value: value of switch
> (i.e. bar as in /foo:bar)
> // switch_val - associative array with the
> switch name as the key with the switch value
> // as the value. (i.e.
> switch_val["foo"] = "bar" as in /foo:bar)
>
> var args = parseArgs(q, "articles");
> if ( args.switches.length > 0 )
> {
> switch( args.switches[0].name )
> {
> case "a":
>
> document.iisfaqf["_ctl3:JumpToArticle"].value =
> args.q
> break;
> default:
> document.iisfaqf["_ctl3:Search"].value
> = args.q
> break;
> }
> }
>
>
> else
> {
> document.iisfaqf["_ctl3:Search"].value =
> args.q
> }
>
> // FORM variables for iisfaqf
> //document.iisfaqf.__VIEWSTATE.value = "";
>
> // The wizard assigned the search string to
> this form field value because
> // this field was the active element when the
> search file was generated.
> // Change this to args.q if the search string
> is parsed with parseArgs.
> // document.iisfaqf["_ctl3:Search"].value = q;
> //
> document.iisfaqf["_ctl3:JumpToArticle"].value = "";
>
> submitForm(iisfaqf);
> }
> ]]></script>
> <copyright>
> The following applies if this file is included
> and distributed with Dave's Quick Search Deskbar:
> Copyright (c) 2002 David Bau; Distributed under
> the terms of the GNU Public License, Version 2
> (http://www.gnu.org/copyleft/gpl.txt)
> </copyright>
> <created_by>
> This search file was initially created on
> 02/03/03 at 15:48:29
> by Dave's Quick Search Deskbar Search Wizard
> version 0.9.1 (beta),
> Copyright (c) 2002 Glenn Carr; Distributed under
> the terms of the GNU General Public License, Version
> 2
> </created_by>
> </search>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
DQSD-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dqsd-devel