• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Validate dynamic datatype in cfinput field.

Participant ,
Oct 25, 2016 Oct 25, 2016

Copy link to clipboard

Copied

I have pulled all of the datatypes from a query to the database that equate to each variable pulled from the database.

For example:

2016-04-21 07:55:12.0, datetime

Atlanta, nvarchar

I have users select the variable from a select box which also passes the datatype to the next page.

So passed to the second page, for example are, StreetAddress and nvarchar.

On the next page I want to validate in a cfinput, type = text, that the text entered is the database match for nvarchar (or int, datetime, varchar, etc)

Is it possible to match exactly with the database or is my best bet just using the validate for integer and date, default char, as are available in the cfinput validate function?

B.

Views

266

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Oct 26, 2016 Oct 26, 2016

It might be possible but I would not use cfinput to do it. I would do my own client-side validation using the input tag with jquery.validation and write my own server-side validation. Cfinput validation is very remedial and outdated by today's standards. And always get in the habit of using both client-side and server-side validation - client-side is for the user experience, server-side is to keep you application from being hacked.

Votes

Translate

Translate
Advocate ,
Oct 26, 2016 Oct 26, 2016

Copy link to clipboard

Copied

LATEST

It might be possible but I would not use cfinput to do it. I would do my own client-side validation using the input tag with jquery.validation and write my own server-side validation. Cfinput validation is very remedial and outdated by today's standards. And always get in the habit of using both client-side and server-side validation - client-side is for the user experience, server-side is to keep you application from being hacked.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation