I want to be sure to get the existing data from the column in the database and my attempt failed and broke the page.
I have attached the details to access the page
I have attached the details to access the page
If you see that error, then go to the rsobj.php file and queryobj.php and update the Debug setting to true. Then it will give you the actual SQL error. That will be more helpful when debugging this issue.
So the issue is the select menu. I attempted to add to options to the select menu and also retrieve the existing data from the column in the database so that when the page is updated the column data is not deleted. I have copied the code from line #224 on the original page and #243 from the page I updated. These are the lines with the select menu which I am having trouble with. This is a required field.
You should be able to go to Window->Properties and click on the select list. Then click the Dynamic.. button in the properties window. From there you can choose to have it populated from any recordset you have on your page and choose the initially selected value from the update recordset.
The button was not working for me, nothing was clickable. So here is my attempt which seems to be working except the selected item appears twice in the menu. I am also checking to be sure I did not break the required field function.
<div class="lineGroup"> <label for="royalcrown" class="sublabel" > royalcrown or rc pend:<span class="requiredIndicator"> *</span></label>
<select class="formMenufield_Large" name="royalcrown" id="royalcrown" rel="<?php echo((isset($_GET["invalid"])?ValidatedField("stallionupdate","royalcrown"):"".$WADAhorses_update->getColumnVal("royalcrown")."")); ?>" tabindex="5" title="Please enter a value." required="true">
<option value="Royal Crown" <?php if (!(strcmp("Royal Crown", "royalcrown"))) {echo "selected=\"selected\"";} ?>><?php echo($WADAhorses_update->getColumnVal("royalcrown")); ?></option>
<option value="Royal Crown">Royal Crown</option>
<option value="Royal Crown Pending">Royal Crown Pending</option>
<?php
while(!$WADAhorses_update->atEnd()) { //dyn select
?>
<?php
$WADAhorses_update->moveNext();
} //dyn select
$WADAhorses_update->moveFirst();
?>
</select>
<?php
if (ValidatedField('stallionupdate','stallionupdate')) {
if ((strpos((",".ValidatedField("stallionupdate","stallionupdate").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="royalcrown_ServerError">Please enter a value.</span><?php //WAFV_Conditional stallion_update.php stallionupdate(2:)
}
}
}?>
</div>
This:
<select class="formMenufield_Large" name="royalcrown" id="royalcrown" rel="<?php echo((isset($_GET["invalid"])?ValidatedField("stallionupdate","royalcrown"):"".$WADAhorses_update->getColumnVal("royalcrown")."")); ?>" tabindex="5" title="Please enter a value." required="true">
<option value="Royal Crown" <?php if (!(strcmp("Royal Crown", "royalcrown"))) {echo "selected=\"selected\"";} ?>><?php echo($WADAhorses_update->getColumnVal("royalcrown")); ?></option>
<option value="Royal Crown">Royal Crown</option>
<option value="Royal Crown Pending">Royal Crown Pending</option>
<?php
while(!$WADAhorses_update->atEnd()) { //dyn select
?>
<?php
$WADAhorses_update->moveNext();
} //dyn select
$WADAhorses_update->moveFirst();
?>
</select>
should probably be:
<select class="formMenufield_Large" name="royalcrown" id="royalcrown" tabindex="5" >
<option value="Royal Crown" <?php if (!(strcmp("Royal Crown", $WADAhorses_update->getColumnVal("royalcrown")))) {echo "selected=\"selected\"";} ?>><?php echo($WADAhorses_update->getColumnVal("royalcrown")); ?></option>
<option value="Royal Crown Pending" <?php if (!(strcmp("Royal Crown", $WADAhorses_update->getColumnVal("royalcrown")))) {echo "selected=\"selected\"";} ?>>Royal Crown Pending</option>
</select>
I did break the required filed function. It is working on the original file.
That does not give an error message and inserts Royal Crown into the DB column.
With this everything works except it shows the error message even when something is selected -
<div class="lineGroup"> <label for="royalcrown" class="sublabel" > royalcrown or rc pend:<span class="requiredIndicator"> *</span></label>
<select class="formMenufield_Large" name="royalcrown" id="royalcrown" tabindex="5" >
<option value="<?php echo($WADAhorses_update->getColumnVal("royalcrown")); ?>" <?php if (!(strcmp("royalcrown", $WADAhorses_update->getColumnVal("royalcrown")))) {echo "selected=\"selected\"";} ?>><?php echo($WADAhorses_update->getColumnVal("royalcrown")); ?></option>
<option value="Royal Crown">Royal Crown</option>
<option value="Royal Crown Pending">Royal Crown Pending</option>
<option value="Remove from RC">Remove From Royal Crown</option>
</select>
<?php
if (ValidatedField('stallionupdate','stallionupdate')) {
if ((strpos((",".ValidatedField("stallionupdate","stallionupdate").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?><span class="serverInvalidState" id="royalcrown_ServerError">Please enter a value.</span><?php //WAFV_Conditional stallion_update.php stallionupdate(2:)
}
}
}?>
</div>
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.