Hi can some one help me out with the following. This prints every time Empty!
or Full!
whenever there is a blank or a non blank text box is detected.
What I need is the following;
Out of the series of text boxes (in the array) even only one text is detected blank just echo
Empty!
ONLY ONCE not every time there a blank textbox.If ONLY all the text boxes are non-blank, then echo
Full!
only ONCE!
How do you suggest that I change the following? Thank you.
if(isset($_POST['Save']))
{
if(is_array($_POST['name']))
{
foreach($_POST['name'] as $Value)
{if($Value == '')
{
echo "<table border='1'><tr><td>Response</td></tr></table>";
echo "Empty!";
}
else
{
echo "<table border='1'><tr><td>Response</td></tr></table>";
echo "Full";
}
}
}
}
EDIT
echo "<td><input style='width:60px' type='text' name='name[]' id='vtext' class='sc_two' size='80' maxlength='5'></td>
then in a validation code I have the following;
if(isset($_POST['Save']))
{
if($_POST['name']=='')
{
echo "<table border='1'><tr><td>Responses</td></tr></table>";
echo "Empty";}
else
{
echo "<table border='1'><tr><td>Responses</td></tr></table>";
echo "Saved!";}
}