[thelist] One Search, Two Options, Two Actions, Degrade Gracefully

Andrew Strojny astrojny at gmail.com
Fri Jun 2 11:16:31 CDT 2006


Ok, I need the experts to take a stab at this one.

The basic search function I am looking for can be seen on
http://www.cnn.com ( as well as others ). I need one search field,
with two radio button options. Depending on what option is selected,
the button submits a separate form with a different action. I am not
using this for a simple web search, instead searching two different
parts of a site. So I need each option to submit a completely
different form altogether. Being an absolute JS beginner I have no
idea how to accomplish this.

The Kicker:

I know this is probably relatively easy for someone who is well versed
in JS. BUT, I also want it to degrade gracefully when JS is disabled
in the users browser. The CNN search does not degrade gracefully. If
you are trying to search the WEB with JS disabled it still searches
CNN.com. I would like one of the options to disappear when JS is
disabled, or better yet display a message about enabling javascript
where the search box would be, or any other solution that works. This
may involve having to put the forms in the JS, which is OK too.

So if anyone can figure out how to do this and post the JS along with
the HTML that would be awesome.

Thanks!



More information about the thelist mailing list