Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
709 views
in Technique[技术] by (71.8m points)

sendmail - send content from div to email with wordpress form

I have a price configurator based on checkboxes. If one checkbox is checked it send some text to a div. This div content will be created automatically if more checkboxes are checked. Is there any way to send this div content to email as textarea or anything else? Thank you.

I used this code to add

$('input[type="checkbox"]').bind('change', function() {
   var alsoInterested = '';
    $('input[type="checkbox"]').each(function(index, value) {
        if (this.checked) {
            alsoInterested += ( '<div class="item" style="font-size: 18px; line-height: 26px;">' + $('label[for="'+this.name+'"]').html() + '</div>');
        }
     });
    if (alsoInterested.length > 0) {
        alsoInterested = '<div class="rez" style="font-size: 22px;">' + alsoInterested.substring(0,alsoInterested.length-2) + '.';
    } else {
        alsoInterested = '';
    }
    $('#content').html(alsoInterested);});

I want to send the content of $('#content') to email as body message. I have tried to copy content from this div into other div that I have added to my contact form 7 body but this doesn't work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...