Page 1 of 1

Email the value of "checked" checkbox fields from a custom Form

Posted: Mon Oct 19, 2015 4:50 pm
by Ed

Hello,

Do you have a Javascript similar to the one below that will allow me to Email the value of both "Text" fields and "checked" checkbox fields from a custom Form?

Yurii in this forum provided a solution for "Text" fields (below) which works for "Text" fields but not for "checkbox" fields.

var text = "";
//Here you need to fill all fields you want send to email.
text += "EventTitle= " + Apperyio("EventTitle").val() + "";
text += "Company= " + Apperyio("Company").val() + "";
text += "first_Name= " + Apperyio("first_Name").val() + "";
text += "last_Name= " + Apperyio("last_Name").val() + "";
return text;

Thank you in advance!


Email the value of "checked" checkbox fields from a custom Form

Posted: Mon Oct 19, 2015 7:36 pm
by Ed

Can you please forward the above question to Yurii Orishchuk (Employee at Appery) so he can answer it? I am hoping he may have an answer. Thank you.


Email the value of "checked" checkbox fields from a custom Form

Posted: Tue Oct 20, 2015 9:02 pm
by Serhii Kulibaba

Hello Ed,

Please follow this topic: https://getsatisfaction.com/apperyio/...


Email the value of "checked" checkbox fields from a custom Form

Posted: Tue Oct 20, 2015 10:06 pm
by Ed

I don't believe this question was answered at the above link.

Do you have an example Javascript that will allow me to Email the value of both "Text" fields and "checked" checkbox fields from a Form?

The script below only works with "Text" fields:

var text = "";
//Here you need to fill all fields you want send to email.
text += "EventTitle= " + Apperyio("EventTitle").val() + "";
text += "Company= " + Apperyio("Company").val() + "";
text += "first_Name= " + Apperyio("first_Name").val() + "";
text += "last_Name= " + Apperyio("last_Name").val() + "";
return text;


Email the value of "checked" checkbox fields from a custom Form

Posted: Wed Oct 21, 2015 7:10 pm
by Yurii Orishchuk

Hi Ed,

1 For text box you can get values(stored in this text box) with code:

pre

Apperyio("EventTitle").val();

/pre

2 For checkboxed - you can get checked or not this checkbox.

pre

Apperyio("mobilecheckbox_233").find("input").prop("checked")

/pre

So text you can configure like:

pre

var text = "";
//Here you need to fill all fields you want send to email.
text += "EventTitle= " + Apperyio("EventTitle").val() + "";
text += "Company= " + Apperyio("Company").val() + "";

if(Apperyio("mobilecheckbox_233").find("input").prop("checked"))
text += "First checkbox checked";

if(Apperyio("mobilecheckbox_234").find("input").prop("checked"))
text += "Second checkbox checked";

return text;

/pre

Regards.


Email the value of "checked" checkbox fields from a custom Form

Posted: Wed Oct 21, 2015 7:27 pm
by Ed

Thank you Yurii for getting back to me. I will give it a try.

Also, I was wondering, on the Form I have a Pull-Down menu component which includes different email addresses to choose from to send the email to, which works fine.

However, I made sure to include on the Form an additional field to manually enter an email address in case the email address of the person completing the form is not appearing in the Pull-Down menu. Is there a script that I can include in the mapping for the extra email field? Thank you!


Email the value of "checked" checkbox fields from a custom Form

Posted: Thu Oct 22, 2015 3:06 pm
by Serhii Kulibaba

Do you use service mapping for that? If so - please add your value to the storage array which is used in the mapping


Email the value of "checked" checkbox fields from a custom Form

Posted: Thu Oct 22, 2015 6:33 pm
by Ed

Hello Sergiy, do you have an example? I don't quite follow. Thanks.


Email the value of "checked" checkbox fields from a custom Form

Posted: Fri Oct 23, 2015 5:54 pm
by Serhii Kulibaba

1) Save service response into storage variable:
add on service success event JS:
preApperyio.storage.myArr.set(data);/pre
2) Add you value into that array: https://getsatisfaction.com/apperyio/...
3) Use that storage variable in the mapping