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!

Help with validating 2 fields
Last Post 07-12-2010 03:11 PM by David To. 9 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
BSquaredUser is Offline
river guide
river guide
Posts:89
Avatar

--
06-23-2010 08:12 AM

    I need some help with validation.  I have 2 fields - one is a combo  box with a list of some 250 event locations - the other is a plain text box.  

    In my form, people need to select an event location from the combo box - BUT - in the event they don't see their event location listed, they are to use the text box to pass their information on to the sys admins who add the info to the db. They need to select from the list or fill in the text box with new information.

    So my question is - how can I validate for that?  I can't require both at the same time but need an either - or option, where they just have to pick/fill out one.  Is this scenario possible with DF?

    Thanks in advance...

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    06-24-2010 12:56 PM

    Hi Bob,

    The combobox has the option to "allow users the ability to add item" that you can mark when you edit the field.  See it in action in Demo # 26.   That might help you eliminate the need to have a textbox after the combobox if they don't see their option.  You can then set the combobox to required.  Will that fit your needs?

    Candace

    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    06-24-2010 01:12 PM

    I thought about that, but the in-house 'client' decided they wanted the admins to vet the new information to make sure it's clear, that the location is where it's supposed to be and that it gets put into the database in the right format. Also, it looks like the add option in the combo box only persists for the browser session and we need it to be added to the database.

    The reason for the second field is that we will have several dozen volunteers entering information to registering events for our organization. We need to have that info in a specific format so we can feed it into Google Maps so the end user can search for an event and get directions to it from the maps. If the info goes to the admin, they can check it for accuracy and submit it to the database in the correct format.

    If DF can't differentiate, that's okay. Process wise, if the info does not get selected from the list or entered in the other field, the admin will have to contact the submitter anyway - it's not a show stopper. I was hoping there was a way to flag the submitter and save the admin a little bit of work if at all possible.

    Thanks for the good suggestion though. I'm glad to understand how that feature works.

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

    --
    06-24-2010 04:38 PM
    HI, this can easily be done with SQL validation. Just create one stored procedure and pass both fields to it to check if they chose something from the combobox and if not, then make sure they enter something in the textbox field. If you have trouble coming up with the SQL validation stored procedure, feel free to reply and I can write one up quickly for you. -- David
    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    06-24-2010 06:58 PM
    Thanks David - I had a hunch that SQL validation might be the ticket but couldn't see how. If you have something quick that you could whip up that would be ideal - my SQL skills are still pretty basic - I could probably come up with checking for data in the two fields but am clueless as to how to get that back to DataForms. So, yes - any additional help you could offer there would be much appreciated.
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    06-30-2010 04:28 PM
    Hi, let's say your combobox shortname is called "EventLoc" and the textbox is called "EnterLoc". Note that the combobox, you are using SQL query so perform a union like:

    select '-- Please choose Event Location --' as questionoption, '-1' as questionoptionvalue
    union all
    select EventLocation as questionoption, EventLocation as questionoptionvalue
    from tablename

    NOTE: EventLocation would be the columnname and tablename would be your tablename if you are retrieving from an SQL table; if you entered them by hand, then simply put '-- Please choose Event Location--' as first question and '-1' as first questionoptionvalue

    Then under Module configuration / Validation Configuration, check "Enable Custome SQL validation script".

    In "Validation SQL query", call this: usp_CheckLoc '$(EventLoc)','$(EnterLoc)'

    In Validation Error Message, type in your error message.

    GO to host / sql and execute the following stored procedure:

    create procedure usp_CheckLoc (@EventLoc nvarchar(200),@EnterLoc nvarchar(200))
    as
    begin
    if @EventLoc = '-1' and @EnterLoc = ''
    select 0 as IsValid
    if @EventLoc != '-1' and @EnterLoc != ''
    select 1 as IsValid
    if @EventLoc = '-1' and @EnterLoc = ''
    select 0 as IsValid

    end

    David
    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    07-05-2010 12:01 PM
    Excellent and thank you very much. Can you run multiple custom validations at the same time?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    07-06-2010 12:04 PM
    Hello BSquared,

    Yes this is possible to accomplish. You can have each field with a custom validation.  But you can't run multiple custom validation queries on the same field, only one custom validation per field.

    I hope this helps you.

    Thanks,

    Ryan
    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    07-07-2010 10:59 AM
    Well, I thought I had it figured out.  When I go to Module Configuration > Validation Configuration, I have custom SQL Validation checked, the sproc is "sp_CheckRecruitmentEventLocation '$(eventLocation)','$(eventAdd)'" and I have a custom error message set but don't get that message when I submit the form

    The query works fine in SQL Manager - blanks return 0's and everything else is a 1 but I've obviously got something wrong because I don't see any validation message when both fields are blank.

    Any idea what I'm doing wrong:?
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    07-12-2010 03:11 PM
    Well, can you enable Debug Mode and see what is actually passed to the stored procedure when you submit your form? This would narrow down the issue. -- David To
    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