|
 |
pro_php thread: Java/PHP Question
Message #1 by "Bill" <bige88fan@c...> on Mon, 11 Nov 2002 17:07:34
|
|
Correct
Jorge :)
----- Original Message -----
From: "Kyle Ketterer" <bige88fan@c...>
To: "professional php" <pro_php@p...>
Sent: Monday, November 11, 2002 11:43 PM
Subject: [pro_php] Re: Java/PHP Question
> Ok, so I would add a onchange=\"\" tag to the select box right? So it
would
> say onchange=\"myfunction();\"
>
> ?
>
> Thanks,
>
> -Kyle.
> ----- Original Message -----
> From: "jorge" <jorge@d...>
> To: "professional php" <pro_php@p...>
> Sent: Monday, November 11, 2002 6:44 PM
> Subject: [pro_php] Re: Java/PHP Question
>
>
> > Hi Bill:
> >
> > I am giving you a couple of ideas
> > place your select boxes where you want then to appear all hidden use a
> > function like the following to show them
> >
> > function myfunction()
> > {
> > var xxx = eval(document.myForm.mySelect.value);
> > switch(xxx)
> > {
> > case "category_one":
> > document.myForm.mySelectSubcategoryOne.style.visibility
> > "visible";
> > break;
> > case "category_two":
> > document.myForm.mySelectSubcategoryTwo.style.visibility
> > "visible";
> > break;
> > defautl:
> > }
> > }//function ends
> > another idea is all the option tags are part of the options array
> > so you can have your select box of subcategories visible but you can
have
> > hidden all the options
> > then run a similar function just to make visible
> > case "category_one":
> > for(i=0;i<MySetvalue1;i++)
> > {
> > document.myForm.mySelectSubcategoryTwo.options[i].style.visibility
> > "visible";
> > }
> > break;
> > case "category_two":
> > for(i>MySetvalue1;i<MySetvalue2;i++)
> > {
> > document.myForm.mySelectSubcategoryTwo.options[i].style.visibility
> > "visible";
> > }
> >
> > Hope this helps you if not send me the code to do it
> >
> > Jorge
> > :)
> >
> > ----- Original Message -----
> > From: "Bill" <bige88fan@c...>
> > To: "professional php" <pro_php@p...>
> > Sent: Monday, November 11, 2002 7:36 PM
> > Subject: [pro_php] Re: Java/PHP Question
> >
> >
> > > Ok, I understand that now...But the main thing I need to know is how
the
> > > actual function is performed in javascript. Like, I need the function
to
> > > send the <option></option> which will be stored in the javascript
> function
> > > to be sent to the "subs" select box when somebody selects the like
> parent
> > > category. Anybody know? Thanks,
> > >
> > > -Kyle.
> > >
> > >
> > >
> > >
> > >
> > > > I will use the onChange event to change the visibility property i
have
> > > done
> > > this Believe it or not to avoid the form to be submited twice just for
> > fun.
> > > you can have your elements.visibility set to false that means all of
> your
> > > select are hidden use an if or swhitch to see which one to show
> > >
> > > Jorge
> > >
> > > ----- Original Message -----
> > > From: "Bill" <bige88fan@c...>
> > > To: "professional php" <pro_php@p...>
> > > Sent: Monday, November 11, 2002 5:07 PM
> > > Subject: [pro_php] Java/PHP Question
> > >
> > >
> > > > This question involves the use of java in form manilpulation with
the
> > use
> > > > of PHP. I don't java THAT well, but I know some. I searched the net
> for
> > a
> > > > java function that could do what I wanted, but couldn't find one:(
So
> I
> > > > come here again:) Anyways what I want to do is have a form select
box
> > > > display a list of categories in another select box(in <option> form
of
> > > > course) when I select what parent category. Basically this is a
mini-
> > > > layout of what I need to do:
> > > >
> > > > <form action=\"bla.php\" method=\"post\">
> > > > <select name=\"main\">
> > > > <option value=\"Sports\" onClick=\"Sports(this.form>\">
> > > > <option value=\"Trading\" onClick=\"Trading(this.form)\">
> > > > </select>
> > > >
> > > > Ok, you see above that I have 2 MAIn categories, now I want to
display
> > > the
> > > > sub-categories which will already be stored in the java function
after
> I
> > > > know what IT is lol
> > > >
> > > > I want to display the result sub-categories in this select box
below:
> > > >
> > > > <select name=\"subs\">
> > > > </select>
> > > >
> > > >
> > > > Here is the java function that I found, but I don't know if it can
> > > help...
> > > > <SCRIPT LANGUAGE="JavaScript">
> > > > function Sports(form) {
> > > > var TestVar = form.subs.SelectedIndex;
> > > >
> > > > I WANT TO WRITE a couple <option></option> to the subs select box
> here!
> > > >
> > > > }
> > > > </script>
> > > >
> > > > Understand what I'm trying to do? When a user clicks on the "Sports"
> > > > or "Trading" option in the "main" select box, I want to display it's
> > sub-
> > > > categories using *some* javascript functions? Can anybody help?
> > > >
> > > > Thanks,
> > > >
> > > > -Kyle.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > }
> > > > </SCRIPT>
> > >
> > >
> >
> >
> >
> >
>
>
>
|
|
 |