Link to home
Start Free TrialLog in
Avatar of ommer
ommer

asked on

Input Validation help needed

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!


Avatar of richswyatt
richswyatt

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.
Avatar of ommer

ASKER

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.

You could send via JavaScript from the IFRAME to the "Parent" frame.

window.myVar=window.MYIFRAME.myVarInTheIframeHere
Avatar of ommer

ASKER

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!

 
ASKER CERTIFIED SOLUTION
Avatar of richswyatt
richswyatt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial