Multiple Contact Form 7 fields to post
-
I’m using Contact Form 7, and have a total of 18 fields in the form. I’m looking for a way to post all 18 fields into one long post, but I can only get a title and one field to post. I’ve done a ton of digging, and found a possible solution using js, but the form is no longer creating any posts nor is it sending notification emails anymore. Here is what I have in the “Form” tab of Contact Form 7:
<h3>ALL fields are REQUIRED</h3> <p>Change Request Title (multiple words need "-" between them e.g. Test-Change):<br /> [text* post_title] </p> <p>Name:<br /> [text* requester-name id:requester-name] </p> <p>Your Email:<br /> [email* requester-email id:requester-email] </p> <p>Implementation Date:<br /> [date* imp-date id:imp-date] </p> <p>Implementation Time:<br /> [time* imp-time id:imp-time time-format:HH:mm] </p> <p>Duration (What time will the change be finished?):<br /> [time* dur-time id:dur-time time-format:HH:mm] </p> <p>Please describe the change (e.g. Why is it needed? What result is expected?):<br /> [textarea* textarea-description id:textarea-description] </p> <p>Was the change tested?:<br /> [radio radio-tested id:radio-tested "Yes" "No"] </p> <p>If Yes, how was the change tested? If No, why not?:<br /> [textarea* textarea-tested id:textarea-tested] </p> <p>What is the expected impact to business? (e.g. Will downtime be experienced? What depts will be impacted?):<br /> [textarea* textarea-impact id:textarea-impact] </p> <p>Is there a rollback plan?:<br /> [radio radio-rollback id:radio-rollback "Yes" "No"] </p> <p>If Yes, what is the plan? If No, why isn't there a rollback plan?:<br /> [textarea* textarea-plan id:textarea-plan] </p> <p>Contacts (Name, extension, cell of who should be notified if escalation is necessary?):<br /> [textarea* textarea-contacts id:textarea-contacts] </p> <h3>RISK ASSESSMENT</h3><br /> <p>Can or will the change cause an outage?<br /> [radio radio-outage id:radio-outage "Yes" "No"] </p> <p>Can an entire location or dept be impacted or experience an outage?<br /> [radio radio-location id:radio-location "Yes" "No"] </p> <p>Is there any risk that a failed change will not be detected immediately?<br /> [radio radio-detect id:radio-detect "Yes" "No"] </p> <p>Will the recovery process take longer than the time to implement?<br /> [radio radio-time id:radio-time "Yes" "No"] </p> <p>Can or will security or confidentiality be compromised?<br /> [radio radio-security id:radio-security "Yes" "No"] </p> <p>Supervisor's email:<br /> [email* email-sup id:email-sup] </p> <p>[submit "Post"]</p> <script type="text/javascript"> (function($) { $(document).ready(function() { // CHANGE: list all field id's here $('#requester-name, #requester-email, #imp-date, #imp-time, #dur-time, #textarea-description, #radio-tested, #textarea-tested, #textarea-impact, #radio-rollback, #textarea-plan, #textarea-contacts, #radio-outage, #radio-location, #radio-detect, #radio-time, #radio-security, #email-sup').change(function() { // CHANGE: Format how you want the fields to come out in the post var content = "Requester Name: "+ $('#requester-name').val() + "<br/>" + "Requester Email: "+ $('#requester-email').val() + "<br/>" + "Implementation Date: "+ $('#imp-date').val() + "<br/>" + "Implementation Start Time: "+ $('#imp-time').val() + "<br/>" + "Implementation End Time: "+ $('#dur-time').val() + "<br/>" + "Change Description: "+ $('#textarea-description').val() + "<br/>" + "Was the change tested?: "+ $('#radio-tested').val() + "<br/>" + "If Yes, how was the change tested? If No, why was the change NOT tested?: "+ $('#textarea-tested').val() + "<br/>" + "Impact to business (Will downtime be experienced? What depts will be impacted?: "+ $('textarea-impact').val() + "<br/>" + "Is there a rollback plan?: "+ $('#radio-rollback').val() + "<br/>" + "If Yes, what is the rollback plan? If No, why is there not a rollback plan?: "+ $('textarea-plan').val() + "<br/>" + "List contacts to be notified if escalation is necessary (Name, ext, cell): "+ $('textarea-contacts').val() + "<br/>" + "Can or will the change cause an outage?: "+ $('radio-outage').val() + "<br/>" + "Can an entire location or dept be impacted or experience an outage?: "+ $('radio-location').val() + "<br/>" + "Is there a risk that a failed change will not be detected immediately?: "+ $('radio-detect').val() + "<br/>" + "Will the recovery process take longer than the time to implement?: "+ $('radio-time').val() + "<br/>" + "Can or will security or confidentiality be compromised?: "+ $('radio-security').val() + "<br/>" + "Supervisor Email: "+ $('email-sup').val() + "<br/>"; if ($('#post_content').length > 0) { $('#post_content').val(content); } else { var postContentInput = $("<input>").attr("type", "hidden").attr("name", "post_content").val(answer); $(this).parents('form:first').append($(postContentInput)); } }); }) })(jQuery); </script>Any ideas where I’m going wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Multiple Contact Form 7 fields to post’ is closed to new replies.