Use w/ Profile Fields

WISEOZ - December 5, 2007 - 21:24
Project:Spry Framework
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

I'm not currently using this module but it looks really interesting. I'd like to use it for the user registration form where I'm also using CCK text fields with the nodeprofile module. Can these validations be used for Profile fields or the standard Username and E-mail fields?

#1

scottrigby - December 7, 2007 - 16:24
Version:5.x-1.0» 5.x-1.x-dev
Category:feature request» bug report
Priority:normal» critical

I'm attempting to do this right now.
I've enabled nodeprofile and successfully added a "billing information" content type (maximum population 1). I've added CCK fields to that, and so far all has been ok.
Except it doesn't do validation, like spry does which Is why I want to use the Spry module. Anyway I'm posting here my desired goal is similar to yours.

I installed the Spry module, and followed the installation instructions in the Read Me file (downloaded framework from Adobe, placed in spry/spry folder, enabled module, etc).
I added a new CCK field in my new nodeprofile content type, called credit_card_number.
However, the spry validation field doesn't seem to show any spry functionality for me. I can't see what I could be doing wrong. Here's what I did:
I selected:
- Spry validation text field
- Rows: 1
- Minimum character: 16
- Validtion type: Credit Card
- Counter Type: Remaining
- Format: Visa [though I'd like this to be done using active select, so use rcan select their credit card - but I'd like to get it to work for at least one first]
- Pattern: [I left blank]
- Required: yes
- Text processing: plain text

When I create a new instance of my 'billing information' content type, I see the field, but spry validation doesn't seem to do anything. Even the counter I enabled as a test doesn't display.

Please let me know if there's something else I should be doing - or something I should not be doing - in order to get this to work!

Thanks a lot --
Scott

#2

scottrigby - December 7, 2007 - 17:11

By the way, I looked at my source and found that the javascript vars are missing.

For instance, on the adobe spry demo pages, they always have something like the following at the very bottom of the page:

<script type="text/javascript">
<!--
var theTitle = new Spry.Widget.ValidationTextField("theTitle", "none", {useCharacterMasking:true, regExpFilter:/^[^\'"\*]{0,15}$/, validateOn:["change"]});
var theDate = new Spry.Widget.ValidationTextField("theDate", "date", {useCharacterMasking:true, format:"mm/dd/yyyy", hint:"mm/dd/yyyy", validateOn:["change"]});
var theDuration = new Spry.Widget.ValidationTextField("theDuration", "integer", {useCharacterMasking:true, validateOn:["change"], allowNegative:false});
var theRating = new Spry.Widget.ValidationSelect("theRating", {validateOn:["change"]});
var theStudio = new Spry.Widget.ValidationSelect("theStudio", {validateOn:["change"]});
var theDescription = new Spry.Widget.ValidationTextarea("theDescription", {useCharacterMasking:true, minChars:20, maxChars:180, counterType:"chars_count", counterId:"Countvalidta1", validateOn:["change"]});
var checkboxes = new Spry.Widget.ValidationCheckbox("checkboxes", {validateOn:["change"], maxSelections:3});
var dvdVersion = new Spry.Widget.ValidationRadio("radios", {validateOn:["change"]});
//-->
</script>

Could the fact that this is missing be part of the problem?

#3

scottrigby - December 19, 2007 - 01:15

bump?

#4

Rob Loach - December 19, 2007 - 14:44

No Javascript is outputed?

#5

scottrigby - December 21, 2007 - 16:54

Correct - none I could see, but was expecting to find (as in #2 above).
But I'm not an expert, and don't know how the Drupal spry module works differently than, say, adding spry-validated forms through dreamweaver. I only compared to the source of other pages with spry forms made that way, and wondered if this missing part could be the problem. (?)

 
 

Drupal is a registered trademark of Dries Buytaert.