Page 1 of 1

textbox help....

Posted: Tue Jun 28, 2005 3:04 am
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

Posted: Tue Jun 28, 2005 3:15 am
by timvw

Posted: Tue Jun 28, 2005 3:17 am
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
  }
}

Posted: Tue Jun 28, 2005 3:22 am
by pleigh
tnx guys...sorry...even i, am confused of my question...:D...but i'll try your advises..