Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
868 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...