GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 22-Jul-2003, 04:48
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

client side problem


hi,
i got problem regarding client side combo boxes as u see kunde combo link associated with projekt combo,i mean to say on change kunde i can see associated link in project so what i did i use javascript to achieve this,is it possible to use php to get achieve this one as u can see these kunde and projekt values r coming from database but i hard coded in javascript to get associated value

for eg. Kunde having values
apple
mango
pine
and when change on apple u get values in project like
tasty
sweet
nutitious

for more clear www.javascriptkit.com

is it possible to use PHP to achieve this as i dont want to hard code the projekt values in javascript like i did
group[0][0]=new Option("tasty","tatsy");
group[0][1]=new Option("mango","mango");
group[0][2]=new Option("nutitious","nutitious");

PHP Code:

<td  align="center">
<select name="kunde" onchange="redirect(this.options.selectedIndex)">
<? foreach($kunden as  $value) { ?>
<option value="<?= $value ?>" <? if ($HTTP_POST_VARS['kunde'] == $value){ echo "SELECTED";}?>><?= $value ?></option>
 <? } ?>
 </select>
 </td>

<td  align="center">
<select name="projekt">
 <? foreach($hprojekt as  $value) { ?>
<option value="<?= $value ?>" <? if ($HTTP_POST_VARS['projekt'] == $value){ echo "SELECTED";}?>><?= $value ?></option>
<?  } ?>
 </select>
</td> 

<script language="javascript" src="doublecombo.js"></script>

please let me know is it possible to get this task done by PHP as this one is server side

thanks
  #2  
Old 22-Jul-2003, 06:36
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: client side problem


This part of your post:
Quote:
Originally posted by zuzupus
... projekt values r coming from database but i hard coded in javascript to get associated value...

Can you post the data (exactly the way it looks on the form / javascript) you hard-coded into the page?
  #3  
Old 22-Jul-2003, 06:47
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

Re: Re: client side problem


//when user selects kunde items,it will get corresponding projekt items
Code:
var groups=document.tstest.kunde.options.length var group=new Array(groups) for (i=0; i<groups; i++) group[i]=new Array() group[0][0]=new Option("00_1001_Orga","00_1001_Orga"); group[0][1]=new Option("00_1002_Werb","00_1002_Werb"); group[0][2]=new Option("00_0000_Pause","00_0000_Pause"); group[1][0]=new Option("1200_1850_0100_Licht","1200_1850_0100_Licht"); var temp=document.tstest.projekt function redirect(x){ for (m=temp.options.length-1;m>0;m--) temp.options[m]=null for (i=0;i<group[x].length;i++){ temp.options[i]=new Option(group[x][i].text,group[x][i].value) } temp.options[0].selected=true }
 
 

Recent GIDBlogNot selected for officer school by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
Geforce FX 5600 Ultra problem jenovasbirth Computer Hardware Forum 1 04-Oct-2003 17:00
tree problem zuzupus MySQL / PHP Forum 0 01-Aug-2003 08:27
cols width problem zuzupus Web Design Forum 4 23-Jul-2003 06:48

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:05.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.