473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

search depending on what user selects

what i want to do is create several radio buttons and a textbox for
searching purposes. the search will perform a search depending on
which button the user selects.

here is what i have now:

- for each radio button, i use the onClick event handler, which calls
a function called showMe()

- showMe() {
if (button 1 was selected)
document.write('form which will search down path A');
else if (button 2 was selected)
document.write('form which will search down path B');
else if (button 3 was selected)...
}

this works, but once the user makes their selection, the search form
will pop up on another page. how do i fix it so that the search form
will display on the same page as the radio buttons? Is there any
other way to accomplish this?
Jul 20 '05 #1
1 1537
bdawg wrote:
what i want to do is create several radio buttons and a textbox for
searching purposes. the search will perform a search depending on
which button the user selects.

here is what i have now:

- for each radio button, i use the onClick event handler, which calls
a function called showMe()

- showMe() {
if (button 1 was selected)
document.write('form which will search down path A');
else if (button 2 was selected)
document.write('form which will search down path B');
else if (button 3 was selected)...
}

this works, but once the user makes their selection, the search form
will pop up on another page. how do i fix it so that the search form
will display on the same page as the radio buttons? Is there any
other way to accomplish this?


Hi,

What excactly do you expect javascript to do? Overwrite your old form? It
will not.
You CAN make a form on a existing page from scratch and change that form,
but that takes a lot more effort than just document.write, and is most of
the time completely unneeded and overcomplex. Of course, that depends on
your requirements.

I would advise you to take another route.
here are 2 suggestions:
1) Maybe it is a lot easier to make a frame which contains the form, and
switch the content in that frame depending on the radiobuttonactions.

2) If your only diffence between between the forms is some searchpath (I
don't know what that means), maybe it is a lot easier to set some hidden
variables in the form that tell the receiving script what to search.

Hope that helps.

Good luck.
Regards,
Erwin Moller

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Alan | last post by:
I'm just about to start a project that needs to combine the results of a SQL Server query with the results of an Index Server query. The basic idea is that the user enters/selects a bunch of search...
2
by: gene.ellis | last post by:
I have content about projects that I store in a MS SQL database. People access this information through pages which are dynamically created in PHP. Since my content is stored in the database, how...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
2
by: Renato Cramer | last post by:
Hello All, There is data of several enterprises (ours clients) in a single database. All tables have a column on primary key what identify the enterprise called id_enterprise. My objective is...
5
by: kirpi | last post by:
In order to instant retrieve a word definition, I let a javascript add the word to the search url of various sites. Example: for the word "word" I create: - http://en.wikipedia.org/wiki/Word -...
0
by: gderosa | last post by:
I have searched for hours regarding this but I am trying to make an advanced search page for my application that has drop downs for 'Greater Than', 'Equals', 'Less Than'. For example the search page...
3
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework,...
2
by: Nightcrawler | last post by:
I need some input as to how the cleanest way to code the following. I have a aspx search page with a datalist displaying the results. Above the datalist are 2 textboxes and 2 dropdownlists. The...
4
by: Evanescent | last post by:
Hi Guys, I am trying to create a form which allows the users to retrieve records based on the values entered or chosen in the various combo boxes and textboxes, such as the customer's name, invoice...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.