Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Question Validation using Watermark
Last Post 06-25-2010 06:25 PM by Chad Nash. 10 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Greg E.User is Offline
going with the flow
going with the flow
Posts:38
Avatar

--
06-18-2010 10:29 AM

    I've spent hours working on this. Time to get help.

    I have a required field in my form. The Default Value is set to 'Company Name" and Display Value as Watermark is checked.

    Because the field has a default value I can't force the user to enter a DIFFERENT value in the field.

    I see in a previous post that I can use a regular expression to check the field. The example given was:

    ^.[Company Name].

    So if "Company Name" is still in the field, the validation will fail. This regular expression does not work, Why?

    My 2nd idea was to create a small Stored Procedure that accepted two arguments: '$(Comp)' and 'Company Name', but the stored procedure is not firing despite making all the settings noted in the User's Guide. I know this because the store proc inserts the arguments into a table and the table is empty.

    Greg

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    06-19-2010 12:34 PM
    HI, since you have a default value, there's no need to make this field required. The simplest solution is to use SQL validation on the field. Let's say your shortname field is "Comp". Then do the following:

    Under host / sql:

    create procedure usp_validate_company (@Comp nvarchar(200))
    as
    begin
    if @Comp = 'Company Name'
    select 0 as IsValid
    else
    select 1 as IsValid
    end

    In your Question Validation of the Comp field, call this stored procedure passing along the shortname field like:
    Enable SQL Validation Script: check this
    Validaton SQL Query: usp_validate_company '$(Comp)'
    Validation error message: type whatever you want here

    -- David To
    Greg E.User is Offline
    going with the flow
    going with the flow
    Posts:38
    Avatar

    --
    06-21-2010 11:03 AM
    David ~

    I've double-checked my SQL Validation and it isn't working.

    I created a stored procedure using SQL Server Management Studio. The first thing that the stored procedure does is write a row to a table so that I can prove that it is being called. It then returns "SELECT 0 AS IsValid" (just to test the failure case. I can run the stored proc in Management Studio and verify that it works correctly. When run on the form page, no row is ever written to my "test" table so I know that the store proc is not being called (if it generated an error, I would expect to see that on the page or in the event logs????)

    In my question validation section I have "Enable custom SQL Validation script for this specific field" checked, a Validation Error Message has been entered, and my SQL Statement is in place as "dbo.sp_ValidateResponse '$(Display)','Your Name'" where "Display is the field's Short Name.

    What could be preventing the validation script from even firing?
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    06-21-2010 02:20 PM
    Greg - What happens if you go to host/SQL and copy/paste your query?

    dbo.sp_ValidateResponse '$(Display)','Your Name'

    If you copy and paste your exact query what happens there?

    -Chad
    Greg E.User is Offline
    going with the flow
    going with the flow
    Posts:38
    Avatar

    --
    06-22-2010 05:03 AM

    If I paste and run the query it works perfectly (IsValid is 0) and the two parameters that I pass into the stored procedure are successfully written to my "tracking table" proving that the store proc. ran as expected.

    If you want temporary Admin access to the portal, I can arrange that.

    -gpe

    Greg E.User is Offline
    going with the flow
    going with the flow
    Posts:38
    Avatar

    --
    06-25-2010 07:01 AM

     More Information

    I created a brand new question with the following Question Validation settings:

    • Required Field checked
    • Enable Custom SQL Validation checked
    • SQL Query = "select cast(0 as bit) as IsValid" so that it ALWAYS should fail
    • Added an SQL Validation error message

    When I submit the form, the SQL validation error message never shows up and form submits.

    The big question: how is it that the SQL validation is not executing?  This seems like a bug?!? I need a solution ASAP as a client's website launch  is waiting on the resolution of this problem.

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    06-25-2010 08:03 AM
    Hi Greg... That seems very strange, it might be referencing a string and not a bit maybe? What if you try this:

    select cast(0 as nvarchar) as IsValid

    If not please setup a demo of this on www.betasprings.com, if you can duplicate any issues there we can usually help quicker.

    -Chad
    Greg E.User is Offline
    going with the flow
    going with the flow
    Posts:38
    Avatar

    --
    06-25-2010 08:08 AM

    select cast(0 as nvarchar) as IsValid made no difference. I've tried returning a bunch of different data types with no luck.

     
    One more note:  In the same website, I created a new test page in DNN and added a new instance of the Dynamic Forms Module. I setup one question with SQL Validation and I got it to work.
     
    I just can't find any difference between the settings of the two forms that would prevent the SQL Validation Stored Procedure from being called. 
     
    I also ran a test on another website under a previous version of DynForms and it worked OK.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    06-25-2010 08:25 AM
    Maybe its a specific field or combination of fields causing the problem?

    You might:
    1. Enable DEBUG MODE - Does this spit out any specific information?
    2. Make a copy of the form using IPORTABLE Export/Import - Does it work? If not maybe start deleting on other field at a time until we find what might be the culprit?

    -Chad
    Greg E.User is Offline
    going with the flow
    going with the flow
    Posts:38
    Avatar

    --
    06-25-2010 09:51 AM

     I think we understand what's going on. The DynForm module appears to be working correctly but the way in which it validates fields is quirky. Maybe this could be changed in a later release?

    My form has 4 fields Name, eMail, Company, and Phone. email and Phone are validated using a regular expression and Name and Company are validated using SQL Validation. All fields have default values as watermarks.

    If you submit the raw form, DynForms flags eMail and Phone as being illegal but no mention is made of the other two bad fields. If you enter valid eMail and Phone values, THEN you get the error messages for the Name and Company fields.  

    Everyone here is expecting to see a complete list of all bad field values all at once when a form is submitted. The actual behavior is unexpected (and undocumented?).

    DynForms performs all regular express validations first. If all of those checks pass, then and only then does it process the fields with SQL Validation. This makes testing large forms much harder - the testor has to have intimate knowledge of how each field is validated or else it appears as if the field is not being validated correctly.

    Can you confirm this conclusion?

    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    06-25-2010 06:25 PM
    Ahhhh... Yes that makes sense and is actually working by design then (unfortunatly). Basically all client side validation / ASP.net validators fire on the client side meaning before actual postback etc... This includes required fields on most field types, regular expression fields, compare validation etc... For some fields that are custom (and ASP.net doesn't have it's own validation for) or for field validation with logic such as SQL validation these must be fired via server side which is why the validation is handled twice if the first validation fails. It would be somewhat similar of a shopping Cary site if validation failed first on phone number but then later on credit card expire date etc...

    The closest you can get to a single look is to go to module configuration, validation configuration, and choose to disable client side validation. This will give you a consistent look and work for most situations (required fields) but not sure you can do that for regular expressions.


    Thanks,


    Chad
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi