473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ColdFusion Form - Interdependent validation

Hello,

I have what appears to be a very simple problem, but I just can't seem to get it to work properly! Here's the issue: I have an html based form that uses a little bit of coldfusion to send the form contents to a specific e-mail. However, if an input called "Priority" is checked, then the next field "Approved By" must be required. If the "Priority" is not checked, then approved by is not required. Here's the base code, without any validation. Can anyone help?

INPUT TYPE="Checkbox" value="Yes" name="priority" SIZE=5 >
High Priority<br>
Approved By<CFINPUT TYPE="text" name="approvedBy" SIZE=30 >

Thanks in advance!
Jan 10 '08 #1
3 2740
Hello,

I have what appears to be a very simple problem, but I just can't seem to get it to work properly! Here's the issue: I have an html based form that uses a little bit of coldfusion to send the form contents to a specific e-mail. However, if an input called "Priority" is checked, then the next field "Approved By" must be required. If the "Priority" is not checked, then approved by is not required. Here's the base code, without any validation. Can anyone help?

INPUT TYPE="Checkbox" value="Yes" name="priority" SIZE=5 >
High Priority<br>
Approved By<CFINPUT TYPE="text" name="approvedBy" SIZE=30 >

Thanks in advance!
Hi,

In the above case you can use the div tag, using div tag you can able to show & hide the controls according to your requirement.

Please try this out, you can definetely do that.

Regards,
Moorthy
Jan 11 '08 #2
acoder
16,027 Expert Mod 8TB
To add Coldfusion validation for this, check that the checkbox is defined:
Expand|Select|Wrap|Line Numbers
  1. <cfif not IsDefined("Form.priority")>
  2.     <!--- text box validation for Approved by field here... --->
  3. </cfif>
Jan 11 '08 #3
acoder
16,027 Expert Mod 8TB
Hi,

In the above case you can use the div tag, using div tag you can able to show & hide the controls according to your requirement.

Please try this out, you can definetely do that.

Regards,
Moorthy
That wouldn't be validation. That would show/hide with JavaScript, not validate the input. You would still need server-side validation.
Jan 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

60
by: English Teacher | last post by:
Which would be more useful to learn, PHP or COLDFUSION? I know Coldfusion is popular in the work force. Is PHP? Thanks!
2
by: antonyliu2002 | last post by:
I have a page that looks like this: ___txtbx1_____ < Your GPA < __txtbx2____ I am trying to implement user data validation. None of the four controls is required. But I want to validate...
3
acoder
by: acoder | last post by:
How to Upload a File in Coldfusion Use the cffile tag for uploading files to the server. Note that allowing people to upload files is fraught with danger and only trusted users should be...
3
by: sj3vans | last post by:
I'm trying to integrate a ColdFusion application with a webAPI provided by another company to access their services. Their requirements are that requests should be generated using standard HTTP...
4
by: Joergen Bech | last post by:
Just out of curiosity: What is your favorite method of making sure that anything that happens on a form, only happens in response to a single, external event? Take the example below. I have made...
1
by: marcnz | last post by:
I have been charged of creating a coldfusion web site for our company. Our database has a ms sql 2005 backend and ms access frontend. Almost all tables are linked tables with the SQL database,...
106
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all...
6
by: ndeeley | last post by:
Hi, How do I insert a null or blank field into a database using coldfusion? I'm new to CF and its proviing a bit tricky! My database date field accepts null values (I think - theres no default...
2
by: kayox007 | last post by:
hello everyone am really having problems sending mails with coldfussion i configured my cf administrator > mail as follows server: smtp.mail.yahoo.co.uk username ***.***@yahoo.co.uk password:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.