Spry Validation Error with "Invalid Selection" option
I have created a new Update page for a data table containing a field that I elect to display as a list. I have defined that the validation for that list element would be to not allow an invalid value to be submitted, and select "-1" as the invalid value.
DB inserts the following code on the page -
<div class="lineGroup">
<label for="adminLevel" class="sublabel" > adminLevel:<span class="requiredIndicator"> *</span></label>
<div class="errorGroup"> <span id="adminLevel_Spry"> <span>
<select class="formMenufield_Medium" name="adminLevel" id="adminLevel" tabindex="3" onChange="hideServerError('adminLevel_ServerError');">
</select>
<span class="selectRequiredMsg">Please enter a value.</span> </span> </span> </div>
</div>
At the bottom of the page, it also inserts this -
<script type="text/javascript">
<!--
var adminLevel_Spry = new Spry.Widget.ValidationSelect("adminLevel_Spry", { '-1', validateOn:["change"]});
//-->
</script>
DW highlights this line of javascript as containing an error, and so does Firefox's error console, telling me that -
Timestamp: 8/21/2012 11:28:33 AM
Error: SyntaxError: missing : after property id
Source File: adminUsers_Update.php?id=3
Line: 291, Column: 80
Source Code:
var adminLevel_Spry = new Spry.Widget.ValidationSelect("adminLevel_Spry", { '-1', validateOn:["change"]});
Sure enough, if I change the line of javascript to this -
var adminLevel_Spry = new Spry.Widget.ValidationSelect("adminLevel_Spry", { '-1':true, validateOn:["change"]});
then the error goes away. Would that be the correct syntax? I'd guess that this is a bug in DB, no?