How to make an Infopath form read only after it is submitted.

M

Mary T.

My company uses InfoPath extensively to route certain types of information to
the proper employees to get handled. Once a form has been submitted we want
the fields to be read-only and the submit button to disappear. We figured out
how to hide the submit button after the form was submitted, but the fields
are still active. We think we found a way to make the fields read only, but
the rules have to be set on each field. Our form is very complex and we
determined we would have to make about 600 changes!! Is there an easier way?

Mary
 
F

Franck Dauché

Hi Mary,

You can do it by code, by catching the OnBeforeChange event on each control
and Cancel the event. That way you won't have to modify any control on your
form.

Does it make sense?

Regards,

Franck Dauché
 
M

Mary T.

I have multiple submit buttons in the form. Does that make a difference or
can I still try your suggestion?

Mary
 
F

Franck Dauché

The submit buttons can be hidden with conditional formatting (as you pointed
out in your original post). The Event cancelling is great to prevent changes
in textboxes, checkboxes, etc.
You just have to add one node in your schema for read-only (false by
default). Once submitted, that node can be changed from false to true. You
hide or disable some controls based on that value and you catch the
OnBeforeChange event at the form level (1 single event for the entire form).
If the read-only node is true, you cancel the change (regardless of the
control that triggered that event).
Now you ca have multiple read-only nodes and make only part of your document
read-only, depending on the Submit button used. It depends on your business
logic..

Regards,

Franck Dauché
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top