Expand my Community achievements bar.

Can I script an email button to put one of the form fields in the subject line and to name the form?

Avatar

Level 1

This is a fillable form on a website.  We want people to complete the form, then click on the email button to send it to us.  Prefer to have the "name" field populate in the "subject line" of the email, and also rename the form that same field name.  Is that possible?

3 Replies

Avatar

Level 1

I'm new at this, and although your answer was helpful, I still don't understand how to make the Subject of the email populate from the "Name" field in the attached fillable form.

I would also like to rename the form as well, as the "Name" field.  Any help you can provide, would be greatly appreciated!

Avatar

Level 10

In the sample I used the below syntax to send an email..

event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF"});

The highlighted ones are local variables which will hold the value from the form fields.

If you want to get the Subject from Name field in the form, use some thing like this.

     var strSubject = name.rawValue;

     //and then pass the value to the code.

     event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF"});

Hope this helps..

Thanks

Srini