I have jquery pop form to upload a file, after on submit (the page refresh and the pop close) i check something about the file and then if there's something wrong i need to pop up that form again (from the java code?), how could i do that ?
When "something is wrong" the server-side code (this applies to any language) should include within the HTML content Javascript that will trigger the "form" to be displayed again.
You should use ( or must be using) ajax in jquery with a popup. When the user hits "submit", control goes to server side code. The code runs to upload the file. Whatever the result of upload (success/failure), that message is sent to the popup with ajax automatically. In case, there is problem in uploading the file then, along with the failure message, you can send in the div which contains your form.
I think rather than refreshing the page to close the popup, allow the user to close the popup with close button.
As I feel dizzy presently,can't write the code,but will try to break whole procedure in multiple steps:-
- On Trigger(by some event) a pop up form will open from submission,which will have a button which will be calling a
OnClick Event,which will be containing an Ajax call for client server communication - till the response don't
close or fade outthe Pop up box. - from server expect two tags
SUCCESSorERRORa) On SUCCESS, remove formDIVand fade out/close the pop up with a success message b)On Error,display a refreshed formDIV
And so on