Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not passing data

Status
Not open for further replies.

grumpyted

Technical User
May 4, 2005
6
GB
I am trying to use two linked combo boxes to search a mysql database via cgi script.

Using seperate combo boxes the query works, but I can't get the linked combo boxes to pass any data and therefor they bring up all the records in the database.

is the page with the linked combos and is the page with the seperate combos that does work.

Can someone look at the code in and tell me why it is not passing any data to the search?

Thank you
 

Do your options all have values? If not, this might explain why no different search results are returned.

Incidentally, you should really rework your code to avoid the use of eval - it really isn't necessary.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
I realised that it wasn't passing values very late last night/early morning :O(

I don't write js and picked the code from javascriptkit.com.

The script updates the second combo box depending on the option you choose from the first combo box, that seems to work okay.

How do I get it to update the values as well?

I need this as I have over 70 job titles (which is too cumbersome for a single drop down box) and they can be broken down to 6 sections. So I wan to be able to choose the section in the first combo and then have the ten job titles for each section in the second combo.

Any help would be realy appreciated (I'd have your babies, but I'm male, over fifty and bearded, so you may decline ;o)

"not waving, but drowning...
 

To give the options values, you need to modify the "new Option" statements.

Currently, you are only passing 1 parameter - you need to pass 2, the text and a value.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
I have tried two values

data_1_2 = new Option("Director", "Director");

But that was the same. It seems from looking at the form that works that I need to change the <select name="Sector"> value.

How do I do that to pass the name= value for each change of the first combo?

In the form that works I have:

<tr valign=top><td>Sector:</td><td><select name="Sector"><option>Select<option>
Clinical Nurse Manager
<option>Director
<option>Home Manager
<option>Matron
<option>Service Manager
<option>Unit Manager
<option>ward Manager
</select></td></tr>

And that works fine. So how can I set that up?

I do appreciate your input and help. Thank you.


"not waving, but drowning...
 
I think I've done it... I just had to chnage the second combo name value and add another value like: data_1_2 = new Option("Director", "Director");

and it seems to work.

Thank you :O)

"not waving, but drowning...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top