|
Posted by frothpoker on 07/12/06 13:02
I have faced exactly the same problem:
Chose a region,then a county then a district...
Two choices with PHP without using javascript. First one is to present
each question one at a time and pass the values through the forms which
is a PITA!
Second one. Generate a single drop down list that looks like the
following:-
------Primary1
---Secondary1
Tertiary1
Tertiary2
Tertiary3
--Secondary2
Tertiary4
Terrary5
------Primary2
---Secondary3
Tertiary6
Tertiary7
and validate that the user has selected a valid tertiary value before
processing the form
If you want my code post a reply here and I will pm you
Obiron
Chris wrote:
> Hi All,
>
> I did find several Javascript-based sets of code, but knew I need something
> where the JS controls the element but had no 'static' variables or arrays .
> One of them has Javascript refresh the page, and another keeps the
> visibility off of secondary listboxes until the primary one is selected. I
> think I will try this one as the <options> can be populated with PHP, then
> the Javascript/CSS controls when they appear. I did this with a cascading
> menu - where the JS/CSS only controlled the element (byID) and it worked
> fine. If this works out, I will post the final code here.
>
> Thanks,
> Christina
>
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:MpKdnXn-qof3kC7ZnZ2dnUVZ_rqdnZ2d@comcast.com...
> > Gary L. Burnore wrote:
> >> On 10 Jul 2006 16:13:03 -0700, "flamer die.spam@hotmail.com"
> >> <die.spam@hotmail.com> top posted like a moron and wrote:
> >>
> >>
> >>>Mosf of the examples you have seen are probably using javascript, with
> >>>php you realise the page needs to reload when a cat is chosen? PHP
> >>>can't dynamically update the menu without loading the page again, you
> >>>would the user to choose a catergory, then have a submit button to post
> >>>the var or a link like page/index.php?cat1=$cat1 and so forth. Probably
> >>>recommend javascript for this though.
> >>
> >>
> >> The php code can generate the javascript code. Best of both "hello
> >> worlds".
> >>
> >>
> >>>Flamer.
> >
> > And you can generate javascript code without php, also.
> >
> > You completely missed the point.
> >
> >
> > --
> > ==================
> > Remove the "x" from my email address
> > Jerry Stuckle
> > JDS Computer Training Corp.
> > jstucklex@attglobal.net
> > ==================
[Back to original message]
|