943,936 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1200
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 10th, 2008
0

Re: interesting situation

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...
Reputation Points: 10
Solved Threads: 0
Light Poster
akshit is offline Offline
46 posts
since Jun 2008
Jul 10th, 2008
0

Re: interesting situation

Do a conditional on which drop down to present.
php Syntax (Toggle Plain Text)
  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>
Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007
Jul 10th, 2008
0

Re: interesting situation

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.
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help, Dynamic Subject for mail script
Next Thread in PHP Forum Timeline: Array echoing problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC