Recently Viewed...
DNN Modules
SnowCovered Top Sellers

Ultra Media Gallery 5.4
Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

Dynamic Forms 2.7
In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts.

Open-DocumentLibrary v3.0
Powerful, Ajax Enabled, Easy to Use. Document Management has never been better. Open-DocumentLibrary allows DotNetNuke users to share and manage documents in a flexible, intelligent way, offering granular control over Folder and Document access.

Catalyst By DrNuke
The Catalyst skins are professionally designed, coded and packaged by a team of DotNetNuke experts. The skins are available in 12 great colours. This skin is easily customisable with our unique DrNuke EasyMod technology. Try our demo!

XMod 5.1
Version 5 of the perennial best-selling tool for creating data-based solutions in DNN without custom programming. This version focuses on greater flexibility, expandability, and ease-of-use.

Flex By DrNuke
The Flex skins are professionally designed, coded and packaged by a team of DotNetNuke experts. Available in 8 great colours, each with 15 banner images, 2 menu types and a choice of 3 background styles. The entire pack features a total of 2472 skins!

Aero // 32 colors pack // XML-based Flash (v1.4)
aero is a flexible skin pack, featuring 8 incredible base colors, now with a XML-based Flash header.Combine 3 background layouts, 3 widths and 6 headers to create your own, personalized site.Now also in Color Specific Packs in a total of 32 colors!!

Enterprise Forms 4.2
Enterprise Forms is not just your standard form creator module, it is a workflow enabled application providing users, business and developer users a like, the tool to develop form and content management systems. With a workflow enabled back end the possibilities are limited by your imagination.

Ultra Video Gallery 2.4
Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to add videos in various format and automatically convert them to flv format, you also can add videos from embed code and play them in our integrated flash video player.

TimeXP 2008.03 - A Paperless Timesheet Module
This fully-automated, easy to use, web-based timesheet application allows you to coordinate payroll services, and enables project team members to track time worked on projects.
    |   Register   |   Sunday, October 12, 2008   
Data Springs Product Forums...
Subject: Using SQL to validate a value in a text box
Prev Next
You are not authorized to post a reply.

Author Messages
Adrian
Posts:5
skipping stones
skipping stones

05/12/2008 6:24 PM  

I've looked through the documentation but I'm having trouble finding how to do the following.

I have a text box that the user needs to add a valid employee number.

I know how to retreive the employee numbers from a database, but can't see how to use that to validate against the value entered in the text box.

Any assistance would be greatly appreciated.

Kind regards,

Adrian Scott-Day

Chad
Posts:2044
river guide
river guide

05/13/2008 9:51 AM  
Hi. Well in the next release we will probably be adding SQL Validation to each individual question level and not on the complete form. For your situation it shouldn't matter but just a heads up (this will allow you to be able to add multiple SQL validations throughout the form).

For now its pretty straight forward... You need to return one SQL column called 'IsValid' and that SQL column should return either a 0 or 'False'. So... In your case lets say you have an employee numbers table called EmpNumbers. You could do something like this (set this up as a stored procedure to guard against SQL injection etc...)


Select Count(*) as IsValid from EmpNumbers where EmployeeID = '$(EmpIDShortFieldName)'

This way when the user hits submit it will check the Employee ID against the database. If its valid it will return a row count of 1 (meaning True as anything besides 0 or 'False' will render true). So, if the user enters an ID that is not present in the database the SQL statement will return 0 (since the row count on that condition is 0) and therefore the user will fail validation and cannot continue.


Hope this helps!

-Chad
You are not authorized to post a reply.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Forms > Using SQL to validate a value in a text box



ActiveForums 3.7

Copyright 2005 - 2008 by Data Springs, Inc.
Terms Of Use | Privacy Statement