Pete Foulkes 6 Posted September 20, 2020 Share Posted September 20, 2020 On a 'public on the web' Frog site, I was wondering if there was any way a form could be placed on the homepage that the user must complete before other content is revealed? We're doing our virtual open evening as a public site on Frog but we also want to collect visitor data such as parent name, child name, email address etc. Could it be possible with some code that when they hit 'Submit' on the form, it either reveals hidden pages or loads another public Frog site? Quote Link to post Share on other sites
Graham Quince 619 Posted September 21, 2020 Share Posted September 21, 2020 This is a tricky one, because Forms can take a while to load in, generally after the HTML widget. I've had to play around with this on your Frog, search for a site called "Form-based next button" You'll find two pages, one with a form and one called hidden page. I used a text widget to get the page link, then used Inspect to copy the href code. <div style="display: none;" class="pageLink"> <a alt="/frogtrade/form_based_next_button/hidden_page/" data-page-link-cke="/frogtrade/form_based_next_button/hidden_page/" data-cke-saved-href="#" href="#">hidden page</a> </div> <script> setTimeout(function(){ console.log('ready'); $('.btn-success').on( "click", function() { console.log('getting here'); var pageLink = $('.pageLink'); pageLink.show(); }.bind(this)); }, 5000); </script> What is happening here is that the page link is placed inside a DIV, but the style tag hides that DIV from view Then in the script section, a javascript timer runs, waiting 5 seconds (5000 miliseconds). After this, the page is scanned for the form's submit button ( it has a class of 'btn-success'. Once the script knows that button exists, it waits for it to be clicked and then makes the DIV, with the class 'pageLink' visible. Quite a bit of dressing up needed, but it should work for you. 1 Quote Link to post Share on other sites
Pete Foulkes 6 Posted September 25, 2020 Author Share Posted September 25, 2020 Amazing thank you very much. We have our sixth form virtual open evening at the end of October, I can tidy it up before then Quote Link to post Share on other sites