Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have a question about registration form

 
chang Anne
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upload what file? You can also do Client-side validation using javaScript.
 
chang Anne
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"?
 
chang Anne
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic