20 Buttons and one Form with different Subjects
-
I have 20 different buttons and I have one pupup divi contact form. The Subject of the Form, should reflect a value realted to the button that has been pressed.
I have found https://divimode.com/knowledge-base/divi-areas-script-generator/ and I tried to use this script to automatically hide a certain field and show another <div id=”formheader”> tag with the read only information of the hidden field.
<div id="formheader"></div> <script> (function() { DiviArea.addAction('show_area', function(area) { if (! area.hasId('#PopupAnmeldungContactForm')) { return; } var dynamictext= 'Hello Worlds'; var theField = area.get('input[name="et_pb_contact_fieldtitle_1"]'); theField.val(kleingruppe); document.getElementById('et_pb_contact_fieldtitle_1').style.display = 'none'; document.getElementById('formheader').innerHTML = '<h3>' + dynamictext + '</h3>'; }); })(); </script>
I have not found out how I could make the dynamictext really something related to the button thjat has been pressed. So far the script is working ans the form is presented with a read only title/subject that is called Hello Worlds.
I tried already to add on the button a link parameter like this #mypluginid?title=test and then used this script https://www.sitepoint.com/get-url-parameters-with-javascript/ to get the value from the url, but the popup does not work anymore then.
Any other idea how that I can have the value of the button id that was pressed in the scirpt above?
Regards
René
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.