Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Validating "either - or" functionality

I have an upload-file control and a "paste your resume" text box.
User MUST either upload a resume OR paste resume.

If resume uploaded, then the "paste resume" textbox can be empty.
If resume is pasted, then uploaded-textbox can be empty, no need to upload.

*** when user clicks submit, how can I validate if the resume is uploaded . I can check if the paste-resume textbox is empty..it's like at least one thing should have been done when user clicks Submit...

how can I check that?
ASKER CERTIFIED SOLUTION
Avatar of aternex
aternex
Flag of United States of America image

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
Avatar of Camillia

ASKER

ah, didnt think of that way..

was thinking about doing the validation without doing a postback..for example, i have validators to make sure first name is not blank, last name is not blank...i thought i can do the same without doing a post back...
SOLUTION
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
Avatar of shadow77
shadow77

You may want to leave the user the option of changing his mind and submitting a replacement, in which case you would not disable both options once he's made a submission, but would ask him "Do you want to replace ...?" if he does make a second (or alternate) submission.
>>You could also disable the Submit button until you are satisfied that the user did a valid paste or upload

that could be a good way of doing it. Let's see if someone else responds to this thread with other ideas
OK.  The theory is that when you can prevent the user from doing something wrong (through disabling), you won't have to check and then tell him he did the wrong thing.  Of course, you may still have to check for other things.
yeah, i agree....have to ask the designer if it's ok to do it that way...

 I wonder how other job sites do this , for the resume section..