Show Region
I want to show or hide two fields based on a SecurityAssist rule.
I want batchdate (a Select box) to show if $rsDecisions->getColumnVal("batch_date" is null or blank.
(batch_date_select_hide)
I want batch_date (a readonly text field) to show if $rsDecisions->getColumnVal("batch_date" has data.
(batch_date_show)
The rules I set up are:
case "batch_date_select_hide":
$comparisons[0] = array(TRUE, "".($rsDecisions->getColumnVal("batch_date")) ."", 1, "\"\"");
break;
case "batch_date_show":
$comparisons[0] = array(TRUE, "".($rsDecisions->getColumnVal("batch_date")) ."", 5, "01/01/1901");
break;
The fields on the form are:
<p style="margin-left: 20pt;text-indent: 0pt;text-align: left;">
<?php if(WA_Auth_RulePasses("batch_date_select_hide")){ // Begin Show Region ?>
<select name="batchdate" class="TextBox" id="batchdate" >
<?php
while(!$rsBatchDates->atEnd()) { //dyn select
?>
<option value="<?php echo($rsBatchDates->getColumnVal("Batch_Date")); ?>"<?php if (!(strcmp($rsBatchDates->getColumnVal("Batch_Date"), ($rsBatchDates->getColumnVal("Batch_Date"))))) {echo "selected=\"selected\"";} ?>><?php echo($rsBatchDates->getColumnVal("Batch_Date")); ?></option>
<?php
$rsBatchDates->moveNext();
} //dyn select
$rsBatchDates->moveFirst();
?>
</select>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("batch_date_show")){ // Begin Show Region ?>
<input name="batch_date" type="text" id="batch_date" value="<?php echo($rsDecisions->getColumnVal("batch_date")); ?>" readonly/>
<?php } // End Show Region ?>
</p>
When I run the page. Neither field shows up and everything else on the page below that code is not displayed.
Please help.
Frank