Solved

Input Validation help needed

Posted on 2007-04-04
5
217 Views
Last Modified: 2013-12-16
Hi, experts,

I need you help on implementing a data validation.
Users enter a value on a form (Order.cfm) for number of files uploaded.
On the same cfm page, there is this <Ifram>(FileList.cfm), which let users browse through their drive/folders, and upload file(s) to our server, one at a time. (FileList.cfm has form Action =FileGet.cfm. And FileGet.cfm does all the uploads)

Then, the submit button on order.cfm will process the rest of the submission of data.

The validation supposed to be between how many files they said they are going to upload and how many files they actually uploaded.

If there is a discrepancy, they will have to either change the value on the field, or add/remove file from the list within the Iframe.

My order.cfm form cfinput name=”NumofFile” Value=#Order.NumofFiles#”
I believe that value is only available after the submit button is clicked. I have not found a way to retain/retrieve the actual number of files uploaded within the Iframe.

Any suggestion is appreciated!


0
Comment
Question by:ommer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:richswyatt
ID: 18857217
In the file upload routine - save into a variable each time a file is uploaded for that instance and add 1 each time.

Then either write that to a data table associating it with that user. Then, at the place you need to check whether what they said they uploaded and what they actually uploaded, call the data from the table and check it against what they're saying.
0
 

Author Comment

by:ommer
ID: 18858919
Yah, I have been thinking that approach, but I am also wondering maybe by doing something on the client side, I could save couple trips to my db server. Then I had hard time to make the 2nd cfm in the IFrame to return a value to the 1st cfm.

0
 
LVL 5

Expert Comment

by:richswyatt
ID: 18858973
You could send via JavaScript from the IFRAME to the "Parent" frame.

window.myVar=window.MYIFRAME.myVarInTheIframeHere
0
 

Author Comment

by:ommer
ID: 18860425
Ok, great!

Now I have last piece of this pazzle that I don't know where it should fit. In which part of the cfm page should I popup this validation message?

I have to admit that I am new to cfm.

I know I could make a call to get the data at the begining of the page in a <cfquery >. I also see a lot of field level validation within the <td><cfinput...validate="float" required="Yes" class="text">
My form has this action property:
The <cfform action="OrderProc.cfm" name="Order" Method="Post">

I think I could do the db call or IFrame var retrieval BEFORE the submit fire up the next cfm. But I have no idea if I should put them before /<cfform>, before </div>, or before </cfoutput>

This is harder than I thought due to my lack of experience. I have doubled the point value. Thanks!

 
0
 
LVL 5

Accepted Solution

by:
richswyatt earned 500 total points
ID: 18860442
Ok - this is what I'd do:

In the IFRAME (this is where they are uploading, right?) make sure you are populating the javascript variable for each upload...

Now - when they go to do whatever they are doing in the main page - (whether it is a form submit or whatever) call a javascript function that checks whether the variable populated for the uploads matches what they are indicating in the main page. This would be called from the main page.
If so - then let the form submit - if not - then throw an error.
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question