View Full Version : submit button question
gertiebeth
December 13th, 2001, 15:28
I am trying to enable a search box that allows you to check one radio button to search the site and another to search the web. I can't figure it out! Any help?
Dusty
December 13th, 2001, 15:40
What do you mean, you can't figure out how to work it in the script or you don't know how to make it on the page? If it's the former, it's more suited to the CGI forum. If it's the later, that's easy:
Search the...
<input type="radio" name="search" value="site" checked>Site
<input type="radio" name="search" value="web">Web
<input type="submit" value="Search">
gertiebeth
December 13th, 2001, 15:48
Originally posted by Dusty
What do you mean, you can't figure out how to work it in the script or you don't know how to make it on the page? If it's the former, it's more suited to the CGI forum. If it's the later, that's easy:
Search the...
<input type="radio" name="search" value="site" checked>Site
<input type="radio" name="search" value="web">Web
<input type="submit" value="Search">
Yes, I have the CGI script all figured out, but the actual search box is giving me trouble. Now, I understand what you wrote above, but what commands do I need to add so that checking the "site" button will go to one URL and the "web" button to a dirfferent URL?
<FORM ACTION="http://www.domain.com/search.cgi" METHOD=POST>
and what else?
Dusty
December 13th, 2001, 18:07
I see what you're asking. You can't on the page (well, you might be able to using JavaScript, but not straight HTML), you'd have to do that in the script. Take your two scripts, the one for searching the web and the one for searching the site, and merge them together and use the value of the radio button to decided which function to run.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.