Solved

Input Validation help needed

Posted on 2007-04-04
5
214 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
  • 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
YouTube Friendly Video Addresses 3 87
Adobe Acrobat Pro top display text upside down? 5 130
Text Transformation using ActionScript 3 5 140
use of cookies and regulations 1 89
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

825 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