FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help needed with chained selects





welshsteve
Hi everyone. I am after a chained selects solution for the page: www.ldbsa.co.uk/s_submitscore.php

LEVEL ONE
The first select in the chain I want is the "Division" select box.

LEVEL TWO
If "Premier Division" is selected, the "Home Team" and "Away Team" selects get pre-filled with the records from the following SQL statement.

SELECT Team FROM Premier

Likewise, if "A Division" is selected, the "Home Team" and "Away Team" selects get pre-filled with the records from the following SQL statement.

SELECT Team FROM A

LEVEL THREE
Based on which team is selected from the "Home Team" drop down box, the 7 player name boxes below it will need to be pre-filled with data from the following SQL statement. e.g. if the team name is "Priors_1st"

SELECT Player FROM Priors_1st

Likewise the same for the "Away Team"


Ultimately what I'm trying to do is for this form to be submitted and for the following updates to be carried out:

1. League table to be updated based on the scores entered for each team selected - updating table "Premer" or "A" - (I already have a working script for this)

2. Home team player stats to be updated using the data entered

3. Away team player stats to be updated using the data entered.

Is anybody able to help at all?
jmraker
You either fetch the data using ajax or include all the data in javascript in a generated file if you don't think the filesize would be too large.

With ajax it could call a script the select box's onchange event and either return new HTML, or json

A simpler thing that could be done is to split the page up into steps, where page 1 has one set of fields, then it goes to step 2 with the teams/players filled in.
welshsteve
jmraker wrote:
A simpler thing that could be done is to split the page up into steps, where page 1 has one set of fields, then it goes to step 2 with the teams/players filled in.


Yes that would be a simpler way of doing it. Ideally I'd like it in one page, but if doing it in steps gets it to work then cool. I think I could probably do this myself.
Stubru Freak
welshsteve wrote:
jmraker wrote:
A simpler thing that could be done is to split the page up into steps, where page 1 has one set of fields, then it goes to step 2 with the teams/players filled in.


Yes that would be a simpler way of doing it. Ideally I'd like it in one page, but if doing it in steps gets it to work then cool. I think I could probably do this myself.


Either do it in two steps, program it in one step, or pay for someone to do it for you. But I don't think anybody will do it for free, it's quite hard.
Related topics
Help Needed Regarding CGI And Php
Help needed to choose appropriate server.
Help needed from Noobie and other graphic artists.
Any thing suit for beginners better than FrontPage
Wordpess help needed.
phpBB - Installation Tutorial
Help needed
CSS Help needed : Table emulation with divs
A Bit Of Help Needed :P
how to slice images? help needed
Please help me!!!! HTML/Flash help needed!
Big Help needed .
Chained Selects
No icons on backend??
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.