|
I have a script, (which I did not create) that makes form fields required…
<?
function formatText($inputName,$text) {
if ($_SERVER['REQUEST_METHOD']=="POST") {
if(empty($_POST[$inputName])) {
echo '<span class="redBold">'.$text.'</span>';
$_SESSION['ispassed']=false;
}
else {echo $text;}
}
else echo $text;
}
?>
and then:
<td><? formatText("nmF","First:"); ?></td>
This way works fine, but what I am now trying to do is to put it into a php page that is already echoing an output.
Basically I need to change the html part of the code to this: <td>’.formatText("nmF","First:").’</td>
Problem is, all the text gets echoed at the top of the page, not where I want it, in the <td>.
I’ve tried to change all the “echos” and tried <td>’.$formatText("nmF","First:").’</td> but it throws errors…
Anyone have any ideas on how I can change this script?
|