You are viewing limited content. For full access, please sign in.

Question

Question

Use email field from form to fill Email address field for "Save unfinished Form to complete later" functionality?

asked on February 4, 2014

 I have a client that wants to set a default password for saved forms for one of their processes, and would also like to have a field from the form be used to fill the "Enter your email address" field so the user has less input required and we can control the email address put in there.

 

 

I figured this might be a good case to use Javascript for. I was also asked about then setting these fields to be un-editable so they only need to hit "Save"

 

Can someone please help me out with this and let me know if it's even possible to fill these fields like I've been asked to do?

0 0

Answers

APPROVED ANSWER
replied on February 4, 2014 Show version history

Setting a value for the email address is straightforward. In this example, I'm using the value in a field that's been given the email class.

 

$(document).ready(function () {
  $('#IsDraft').click(function () {
  $('input.saveresumeinfo.email').val($('.email input').val());
    $('input.saveresumeinfo.email').attr("readonly","true");
  });
});


Of course, this code is the minimum you'd need to get it to work. Your particular use-case will determine what else the code should handle.

0 0
SELECTED ANSWER
replied on February 4, 2014

I believe this should be possible. Hardcode the value of the password using jQuery, you will always know what that value is. Then for both the email address on your field and the password, you would set the Save unfinished fields to the corresponding values. It looks like their names are tfa_emailadd and tfa_password. You could then add CSS to hide the following classes saveresumeinfo, saveresumeinfo. That would hide the fields and just display the save button. Hope that helps.

0 0

Replies

replied on February 4, 2014

This does not sound like the intended use for this feature. Generally speaking, no one should have access to a user's form drafts except that user (they haven't submitted anything yet, after all) and the user should be able to specify an email address they have access to, as well as a password that they can use to access the submission again.

 

With that said, I'm interested to hear more about your actual use-case.

0 0
replied on February 4, 2014

The use case is rather simple. 

 

The email account we are given access to for the clients internal forms is an internal use only email account. We cannot send emails to email addresses outside the domain. So we want to limit this by using the email address we have automatically filled from lookups when they first open the form.

 

The password can only be used from the link in the email (using the business process id and the instance id, so they really only care to make sure the user can get to the form when they need it. In the particular use case we were asked about from the client, the users will be completing these forms within an hour or two of starting them. 

0 0
APPROVED ANSWER
replied on February 4, 2014 Show version history

Setting a value for the email address is straightforward. In this example, I'm using the value in a field that's been given the email class.

 

$(document).ready(function () {
  $('#IsDraft').click(function () {
  $('input.saveresumeinfo.email').val($('.email input').val());
    $('input.saveresumeinfo.email').attr("readonly","true");
  });
});


Of course, this code is the minimum you'd need to get it to work. Your particular use-case will determine what else the code should handle.

0 0
replied on February 4, 2014 Show version history

Eric, 

 

I think you have rushed to the answer. Would that not cause the field to be read only without checking to see if their is a value? It would also try and set a value to a read-only field if you toggle that check box

 

I instead created a function that on change of the email field I am using, it goes ahead and modifies that email field value. before and after that, it sets read-only to true or false depending on need so the only possible way to use this functionality is to use the Auto-fill from the database look-up.

 

I also set the email on page load and then also change the wording to be more specific to the process and the still visible fields.

0 0
replied on February 4, 2014

The code just illustrates that it is possible; you're encouraged to add to it to make it as robust as it needs to be for your use.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.