Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Search Form, change textbox name on button click
Old 03-22-2006, 08:10 PM Search Form, change textbox name on button click
Novice Talker

Posts: 6
Trades: 0
I have created a form on the index of my website. The purpose of it was to be able to search on three different pages; google, torrentspy, and isohunt.

The problem i am having is that each website has a different name for the textbox they use to search with, for example...
"http://ts.searching.com/search.asp?h=" torrentspy uses an h,
"http://isohunt.com/torrents.php?ihq=" isohunt uses ihq,
so i am wondering, for each button...is there a way to change the name of the single text box i use, for each button

here is my current code

</form>
<form method="get" name="ihSearch" id="ihSearch">
<div align="center">
<p>
<input name="ihq" class="post" type="text" size="40"/>
<input name="submit2" type="submit" style="background : url(/images/other/iso.png);width:185px; height:65px;" class="mainoption" tabindex="5" onclick="document.ihSearch.action='http://isohunt.com/torrents.php'" value="" />
<input name="h" type="submit" class="mainoption" style="background : url(/images/other/to-spy.jpg);width:60px; height:65px;" tabindex="5" onclick="document.ihSearch.action='http://ts.searching.com/search.asp'" value="" border="0">
</p>
<p align="center">
<input name="q" type="submit" class="mainoption" style="background : url(/images/google.jpg);width:150px; height:55px;" tabindex="5" onclick="document.ihSearch.action='http://www.google.com/search'" value="" border="0">
</form>
Alphamonkey is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-23-2006, 07:22 AM Re: Search Form, change textbox name on button click
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Hello Alphamonkey,

Welcome...

It seems to me that if you want to do that and only use one text box you are
probably going to need to parse the info before it goes out. Using asp, php, or
something.

The only other thing that I can think of is that there may be a JavaScript that can
do this. However, I am not personally aware of one, so I guess I have been of no
help at all...

My first take is still doing it with a server side script (the asp, php route)
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-23-2006, 08:02 AM Re: Search Form, change textbox name on button click
Novice Talker

Posts: 6
Trades: 0
can you explain to me how i might do that, im not to familiar with those types of script
Alphamonkey is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 08:11 AM Re: Search Form, change textbox name on button click
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
First thing we need to do is see what is available on your server.

Do you know what kind of server your site is on?

If it is on a Windows server you will probably be able to use asp. But you will have to ask your hosting company to see.

If it isn't on a Windows (box) server - You will probably need to use php.

<rant>If you are using html which I assume you are from the code in your post, you are about to learn some new stuff! server side programming is what it is called, is the meat of web sites. Most people think that it is to difficult to learn.

I use to feel this way. My background with the web is project management and graphic design. I was not a programmer. But now I am using asp and another program called ColdFusion and loving it.. All of the friends here will help ou get through this if you are up to learning something new. </rant>

Any way - first thing you need to do is find out what your hosting company offers. Hopefully it is included for free.

Find out and get back to us.. Then we can help you to get this to work ..
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-23-2006, 01:06 PM Re: Search Form, change textbox name on button click
Novice Talker

Posts: 6
Trades: 0
the site supports php, not asp

i got it to work though
i was surfing the web and i found a script like this
document.form.textarea.value="word"

so i decided to change value to name and it worked

document.ihSearch.ihq.name

Last edited by Alphamonkey; 03-23-2006 at 01:51 PM..
Alphamonkey is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 01:39 PM Re: Search Form, change textbox name on button click
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Alrighty, This is a great start. (I am an asp developer and do not know php, but there are lots of people here that do.)

This would be the simplist way I think.

The form would have a dropdown (jump meu) list for the different searches.
When the user makes a selection from this list, the form is redirectid back to the same page and the rest of the form will be loaded according to the selection.

What happens is the jump menu will have a querystring variable that will let an if statement know which form to load..

I hope this makes sense.

Even though they are using a different technology, you can get the idea of what will happen here. Notice the GET BLUE BOOK VALEUS. As you make selections from the dropdown lists it offers different options.. Only yours will not to be as elaborate- only one selection before they search..

What you will need to learn is how to program an IF statement in php. It is something that will take a little while to learn, but you will be able to, I promise.
go to the php forum and ask them how you can make the if statement for the form.

I hope this helps. Please, don't feel overwhelmed, its not as difficult as it sounds..
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Old 03-23-2006, 02:12 PM Re: Search Form, change textbox name on button click
Novice Talker

Posts: 6
Trades: 0
uh....ya srry i guess i edited my last post after you posted....

ill blame the isp
Alphamonkey is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 02:18 PM Re: Search Form, change textbox name on button click
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Well now you know if you ever want to do it the other way.. (i don't know why i just like this guy-emoticon)
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Reply     « Reply to Search Form, change textbox name on button click
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27955 seconds with 12 queries