Kevin Miller
Posts: 0
Joined: Tue Sep 24, 2013 11:16 pm

How can I add the value of a datepicker component to a string?

How can I add the value of a datepicker component to a string?
I am using sendgrid to email the contents of a form. Sendgrid only let's you map one variable to the the 'email text'. So I used the javascript below to combine all my fields into one string.

var emailtext = "First Name: " + Appery("input_firstname").val() + "\n" + "Last Name: " + Appery("input_lastname").val() + "\n" + "Phone Number: " + Appery("input_phonenumber").val() + "\n" + "Email: " + Appery("input_email").val() + "English Level: " + Appery("input_englishlevel").val();

Which works great. But when I try to include + Appery("input_startdate").val();
[input_startdate is a datepicker component] I get an error saying it is not a function.

What makes the date picker component different from the others? How can I add the date the user selects to my string 'emailtext'?

PS.
Thank you for the tip to use sendgrid from my previous question. I think it will work wonderfully once I am able to include the date in my email text.

Kevin Miller
Posts: 0
Joined: Tue Sep 24, 2013 11:16 pm

How can I add the value of a datepicker component to a string?

Thanks Igor I was able to find a solution!
datepicker was my 5th input field so I was able to get it's value this way and add it to my string.

var startdate = $('input:eq(4)').val();

var emailtext = "First Name: " + Appery("input_firstname").val() + "\n" + "Last Name: " + Appery("input_lastname").val() + "\n" + "Phone Number: " + Appery("input_phonenumber").val() + "\n" + "Email: " + Appery("input_email").val() + "\n" + "English Level: " + Appery("input_englishlevel").val() + "\n" + "Start Date: " + startdate;

Return to “Issues”