if a drop-down item is selected, 2 more fields required

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fariquzeli
Forum Contributor
Posts: 144
Joined: Mon Jun 24, 2002 9:16 am
Location: Chicago
Contact:

if a drop-down item is selected, 2 more fields required

Post by fariquzeli »

I have a drop down menu, and if one of the fields in that drop down is selected, I want to require 2 other fields to be filled in. If that specific item in the drop down menu is not selected, I do not want the other 2 fields to be required.

I'm not 100% sure how to set this up, so here is what I have:

Code: Select all

if ($configuration angle == plastic_disposable)  {
		if (strln($disposable_yearly_usage) <=0) &#123;
		$error .="You must enter the yearly usage if you are using a Disposable Prophy Angle.<br>";
		&#125;
		if (strln($disposable_angle_brand) <=0) &#123;
		$error .="You must enter the Disposable Angle Brand if you are using a Disposable Prophy Angle.<br>";
		&#125;
	&#125;


configuration angle is the name of the drop down, and plastic disposable is the value of the specific item that will require 2 more fields to be checked in. I just want to make sure I did this correct.
Post Reply