jquery - How can I pull my popup content from an external file? -
i'm using magnific popup create popup form. works fine long leave inline, if try move form external file, can't seem load in popup.
as example - taking code "popup form" demo here, create following file, works expected. here working fiddle (courtesy of @anpsmn in response different question).
however, realized use same form in multiple places, tried move form external file. called magnificform.cfm (i working coldfusion code in real form) , contains form element:
<form id="test-form" class="white-popup-block mfp-hide"> <h1>form</h1> <fieldset style="border:0;"> <p>lightbox has option automatically focus on first input. it's recommended use <code>inline</code> popup type lightboxes form instead of <code>ajax</code> (to keep entered data if user accidentally refreshed page).</p> <ol> <li> <label for="name">name</label> <input id="name" name="name" placeholder="name" required="" type="text"> </li> <li> <label for="email">email</label> <input id="email" name="email" placeholder="example@domain.com" required="" type="email"> </li> <li> <label for="phone">phone</label> <input id="phone" name="phone" placeholder="eg. +447500000000" required="" type="tel"> </li> <li> <label for="textarea">textarea</label><br> <textarea style="width: 139px; height: 54px;" id="textarea">try resize me see how popup css-based resizing works.</textarea> </li> </ol> </fieldset> </form>
then tried modify link opens pop-up point file:
<!-- link opens popup --> <a class="popup-with-form" href="magnificform.cfm">open form</a>
this doesn't work - results in empty popup.
i tried pointing form element specifically:
<!-- link opens popup --> <a class="popup-with-form" href="magnificform.cfm#test-form">open form</a>
i tried renaming file magnificform.html. can't seem content of external file load in popup.
turns out needed change type: 'inline'
type: 'ajax'
.
Comments
Post a Comment