interesting situation

Reply

Join Date: Jun 2008
Posts: 46
Reputation: akshit is an unknown quantity at this point 
Solved Threads: 0
akshit akshit is offline Offline
Light Poster

Re: interesting situation

 
0
  #11
Jul 10th, 2008
hey nav33n.

you probably did not understand my requirement(or maybe i am not understanding your solution)....

What is need is this:

there is a form, say P1, where the user specifies whether he is a teacher/student.
Irrespective of his answer, he is re-directed to P2 on submission of P1.

Now, P2 is also a form. If the person == teacher, then P2 (also a form) contains some text field, and a drop-down-list, DDL1.

On the other hand, if person == student, then P2 contains the SAME text fields(as in the case of teacher), but a different drop-down-list, say DDL2.

I can do this using 2 different forms, one for the teacher and 1 for the student, but this is inefficient in case i hav more options as there is large amt of data replication.

pls clarify....

thx a lot...
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: interesting situation

 
0
  #12
Jul 10th, 2008
Do a conditional on which drop down to present.
  1. <?php
  2. if($person=="teacher"){?>
  3. <select name="teacher">
  4. <option value="option1t">option1</option>
  5. <option value="option2t">option2</option>
  6. <?php }else{?>
  7. <select name="student">
  8. <option value="option1s">option1</option>
  9. <option value="option2s">option2</option>
  10. <?php }?>
  11. </select>
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,761
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: interesting situation

 
0
  #13
Jul 10th, 2008
Umm.. probably, You didn't understand my solution. In my example, I submitted to the same page and echoed the selected option, just to give you an idea how it can be done. Anyway, I hope buddylee17's example is clear enough.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC