close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Spry Validation Error with "Invalid Selection" option

Thread began 8/21/2012 9:21 am by msummers194171 | Last modified 8/22/2012 8:06 am by msummers194171 | 1942 views | 4 replies |

msummers194171

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">&nbsp;*</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?

Sign in to reply to this post

msummers194171

I can see that even though I selected validation to prevent an invalid value, and input -1 as the invalid value in the DA panel, after creating that page, I still need to edit the Spry Property inspector for that field to complete the validation and to make the code pass validation. That's a bit obscure I think.

Sign in to reply to this post

msummers194171

After editing in the PI, the javascript becomes this -

<script type="text/javascript">
<!--
var adminLevel_Spry = new Spry.Widget.ValidationSelect("adminLevel_Spry", {isRequired:false, invalidValue:"-1"});
//-->
</script>

Sign in to reply to this post

Jason ByrnesWebAssist

the correct code for the spry validation is:

var adminLevel_Spry = new Spry.Widget.ValidationSelect("adminLevel_Spry", { invalidValue:"-1", validateOn:["change"]});


i have logged this as a bug to corrected in a future update, thanks for reporting the issue so we can address it.

Sign in to reply to this post

msummers194171

Thanks, Jason!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...