textbox help....

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
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

textbox help....

Post by pleigh »

i have a code here for my textfield not to accept if it is empty...

Code: Select all

//check for implementing organizations - lead firm
	if (empty($_POST['leadfirm']))
	{
		$lf = false;
		$message .= 'You forgot to enter the project lead firm<br>';
	}
	else
	{
		$lf = $_POST['leadfirm'];
	}
and i have a textfield that may accept a blank or null field and if the user type some text in this textfield, will be saved in my db....maybe someone out there that can help me construct a code....if i use the above code, the page will prompt the userthat he has to put some text inside the textfield...tnx in advance
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I don't know if I really understand your question. But I think you want to allow this field to be empty if another one is filled in.. correct?

Code: Select all

if($_POST['field'])
{
  // process code

  if($_POST['leadfirm'])
  {
     // process code
  }
}
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

tnx guys...sorry...even i, am confused of my question...:D...but i'll try your advises..
Post Reply