473,387 Members | 1,486 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,387 software developers and data experts.

Issue with cfform validating button was selected/clicked

219 100+
I'm having an issue validating that the "Add" button was selected.....

Expand|Select|Wrap|Line Numbers
  1. <cfform name="NEW_FORM" action="systemSubmit.cfm">
  2.         <tr><td colspan=2 align="center"><h4>Submit New System</h4></td></tr>
  3.         <tr><td align="right">Name:</td><td><input type="Text" name="name" size="50"></td></tr>
  4.         <tr><td align="right">Description:</td><td><textarea  name="description" cols="40" rows="5" maxlength="255"></textarea></td></tr>
  5.         <tr><td colspan=2 align="center"><input type="Submit" name="Add" value="Add"></td></tr>
  6.     </cfform>
  7.  
Here is a snippet from the page it calls:

Expand|Select|Wrap|Line Numbers
  1. <cfoutput>#NEW_FORM.Add#</cfoutput>
  2.  
  3. <cfif isDefined("NEW_FORM.Add")>
  4.     <cfquery name="updateSystem" datasource="Security_Access" dbtype="ODBC">
  5.         insert into tblSystem (name,description,updDateTime)
  6.         values ('#name#','#description#','#DateTime#')
  7.     </cfquery>
  8.     Thanks for your submission!
  9. </cfif>
  10.  
I have the cfform named "NEW_FORM" so I thought I'd be able to select the field by using NEW_FORM.Add

I was able to get around this by not using cfform and just using form, but I'd like to know how I can use cfform.
Sep 26 '07 #1

✓ answered by acoder

Use "form.Add" instead.

7 2787
acoder
16,027 Expert Mod 8TB
Use "form.Add" instead.
Sep 27 '07 #2
dmorand
219 100+
I thought that if I named the cfform, that would be how I'd reference it.

What's the sense of naming my form?
Sep 27 '07 #3
dmorand
219 100+
How do you do the cfm code insert in the posts?
Sep 27 '07 #4
acoder
16,027 Expert Mod 8TB
I thought that if I named the cfform, that would be how I'd reference it.

What's the sense of naming my form?
The name is optional. It's more for the client-side. In fact, you don't even need it for JavaScript because you can use an id to access the form.
Sep 27 '07 #5
acoder
16,027 Expert Mod 8TB
How do you do the cfm code insert in the posts?
Just add a =cfm in the code tag:
[code=cfm]
Sep 27 '07 #6
dmorand
219 100+
Excellent thanks!!!!!!!
Sep 27 '07 #7
acoder
16,027 Expert Mod 8TB
No problem, you're welcome.
Sep 28 '07 #8

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

Similar topics

1
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
6
by: Mike | last post by:
I have a function that is called when the user clicks the submit button, during this function i also set a varaible to "Y" due to that this function does a post back to the page then redirects....
0
by: Jennifer | last post by:
I had this beautiful datagrid on an ASP page (VB.Net as the code behind). When I clicked on a Select Button, the row was selected and the background color changed the way it was supposed to. The...
21
by: Darin | last post by:
I have a form w/ a textbox and Cancel button on it. I have a routine to handle textbox.validating, and I have the form setup so the Cancel button is the Cancel button. WHen the user clicks on...
16
by: Al Santino | last post by:
Hi, It appears displaying a messagebox in a validating event will cancel the subsequent event. In the program below, button 2's click event doesn't fire if you open a dialog box in button 1's...
0
by: sabian08 | last post by:
Please help a newb! Any suggestions are appreciated! My goal is to have all checkboxes=true up to today's month when the "Fiscal Year" checkbox is clicked. Right now, I'm having trouble with the...
1
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that controls do not raise a Validating event if they are contained in a ToolStripDropDown via a ToolStripControlHost item. Please run the following sample and follow the instructions...
1
by: klaul | last post by:
Hi there. I'm having an issue with autopostback, in that it doesn't seem to be working! The webform I am using pulls the data from an AccessDataSource to populate the gridview, which has Edit and...
5
by: chadwick | last post by:
Hi everyone - I have a form that contains a TabControl object with 2 tab pages, TabPage1 and TabPage2. TabPage1 contains two text boxes and a cancel button, which closes the form. I would like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.