aspose file tools*
The moose likes JSP and the fly likes Have a question about registration form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Have a question about registration form" Watch "Have a question about registration form" New topic
Author

Have a question about registration form

chang Anne
Greenhorn

Joined: Jul 02, 2003
Posts: 29
Hello,
I have a form with input text fields and a file field for user registering.
And I have a validation of user personal information like id on server-side.
My question is if the user provide the wrong infromation but he/she already upload the file.
Then He quit the register but the server side have the file.
How should I do to avoid the above problem?
Any suggestions?
Thanks.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Upload what file? You can also do Client-side validation using javaScript.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
chang Anne
Greenhorn

Joined: Jul 02, 2003
Posts: 29
Hello,
In my registration form, there are two textfield,
id(require a unique one <input name="id" type="id">)
user's pic(<input name="userpic" type="file")
I use javascript to validate id and pic for user enter nothing.
I encountered a problem that I have a restriction on id, using
server-side validation but user's pic have already uploaded.
The user press "previous page" on browser, user's uploaded file stay in directory.
Any ideas?
Thanks.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
chang -
I find it difficult to understand your problem.
I encountered a problem that I have a restriction on id, using
server-side validation but user's pic have already uploaded.

Why don't you validate your id before uploading the "pic"?


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
chang Anne
Greenhorn

Joined: Jul 02, 2003
Posts: 29
Hello,
Sorry, I didn't say clearly.
I have two pages.
First page is used for user input(user enter unique id, upload file).
Second page is used to display the error messages(like, Your id is not available..) and let users reenter their id.
In my original thought,
user enter a id and upload the file,
And, I check the id is unique or not and copy the file in folders.
If id is not unique, turn to second page, user just need to reenter the id.
There's a problem in my process of user registration.
As users don't finish their registration but already upload the file(in program I copy the files they provide).
As Andres Gonzalez suggests,
Before uploading the pic I valide the id is valid or not.
My question is How should i remain the file the user provide in second page?
Any suggestions?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

My question is How should i remain the file the user provide in second page?

If I understand what you are asking, and I'm not sure that I do, I don't think you can. The file is being uploaded as part of a multi-part request on the first submission. Deferring the processing of that file to a second request after a verification page is not possible since the uploaded file cannot be carried over to the subsequent request.
Is it not possible to change the manner in which you are conducting registration? It seems odd to me to upload a file prior to successfully
registering. I'd suggest making the file upload a second operation that the user completes after the user id has been successfully validated.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Have a question about registration form