Form Help

TOPIC:

Create a Popup Thank You Message 1 year 8 months ago #231437

  • nobicycle
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 114
  • Thanks: 1
Thank you for this modal popup example. But I get this in the browser console:

modal-form:722 Uncaught SyntaxError: Invalid or unexpected token

The source of which is:

window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}



I suppose this corresponds with

if (event.target == modal) {

at the bottom of the attached piece.
Attachments:

Please Log in or Create an account to join the conversation.

Create a Popup Thank You Message 1 year 8 months ago #231439

  • DarkoCujic's Avatar
  • DarkoCujic
  • Offline
  • Developer
  • Developer
  • Posts: 2154
  • Karma: 67
  • Thanks: 264
Hey,

does the included text file contain all the code from the piece? Because it's missing the end if I'm not mistaken.

From my post:
- and finally after that add the code to manage opening and closing:
echo '<script>
    jQuery(document).ready(function() {
    var modal = document.getElementById("myModal");
    var btn = document.getElementById("myBtn");
    var span = document.getElementsByClassName("close")[0];

span.onclick = function() {
    modal.style.display = "none";
}
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}
});
</script>';

So, if the text file is everything that's in the piece, you're missing the following at the end:
});
</script>';

Regards,
Darko
Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.041 seconds

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!