Link to home
Start Free TrialLog in
Avatar of -Polak
-PolakFlag for United States of America

asked on

Data Validation on an Attachment Field

Would like to know if there is a way to require that a document be attached. Currently, I have the conditional formatting shade red and bold the box when another field is equal to true, but would prefer it to be part of data validation....?
Avatar of Clay Fox
Clay Fox
Flag of United States of America image

Just put a rule on submit that checks if the field is blank or not.
Avatar of -Polak

ASKER

I would like an asterisk or a red outline appear around the box so that the forms user knows that they need to include this attachment when another given field is checked. This is more effective than an error on submit that they won't read until they expand the error in details.
Avatar of -Polak

ASKER

possible?
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
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 -Polak

ASKER

I think I understand what your saying about why you think its better to just put a rule on it; but, doesn't conditionally hiding the attachment control until my ture/false field is checked true eliminate your reason 2 and any other reservations you have?
<I think I understand what your saying about why you think its better to just put a rule on it;>
I'm confused, ... I never said anything about a rule...?

<doesn't conditionally hiding the attachment control...>
... I never said this either...?

My point was that this is a common question here  (validate a control, while still editing the record).
Despite how "logical" this approach seems, it is wrought with pitfalls.

The code I posted is what I tested, and it works.
Did you try it?
What was your determination?

As I also said, I could find no direct way to validate if an attachment field had a value in it, so part of your reason for wanting to do this is what makes this difficult.

JeffCoachman

Avatar of -Polak

ASKER

I won't have a chance to test it until tomorrow.

When I said "This is more effective than an error on submit", you said you disagreed and provided reasons that mainly touched on the issue of users may not fill out the form in the correct order. What I meant by conditionally hiding the attachment field is it gets rid of the issues you raised on incorrect order.

You're point is well taken; but since the audience of this form is fairly non-technical, I still think this work around is more "effective" than an error on submit.
Again, hiding the control may help, but that is not what you originally asked for.

But remember we have a controlling issue here.
...As I stated, there is no direct way (that I am aware of) to validate if an attachment field had a value in it.
So are you saying that you still want to continue with this "validation" if there is no way to detect if the attachment control has a value or not?
Yes or No?

Besides you still have not stated if you tried my code of not and what the result was...?
Please let me know.

JeffCoachman
Avatar of -Polak

ASKER

I will try your code, it will undoubtedly work, and I think it in combination with a rule is the best solution for the question I've asked.
OK, keep me posted
Avatar of -Polak

ASKER

Worked!
Great!

;-)