Solved

Input Validation help needed

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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

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…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

630 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