Jump to content
Sign in to follow this  
ging

Loading and using a .js file in pagelines

Recommended Posts

ging

Hi, The site I'm working on is not live yet. So the above url doesn't pertain to the question. I've been setting up my site and I have a [pl_modal] which when launched has a contact form in it. I've been trying to using JQuery to validate the form and ajax send. In firebug the .js file is loading but no matter what I do the code seems to have no effect on the elements I am targeting. I've even tried simple .addClass() and .css() and see if it would show up in firebug in case my complex ajax submission had errors. None of it works. 1. What is best practices for doing this? 2. how could the .js file show as loaded and have no effect? Any help would be greatly appreciated. Thanks, I added this to the template header.php file in the



	It loads but doesn't work.
	
	Here is my html with the short tags
	
	
[pl_modal title="Book An Assessment Meeting" type="btn" colortype="warning" label="I Want to Book A Meeting"] [/pl_modal]
[pl_modal title="Contact Method" type="btn" colortype="warning" label="Contact Me With More Info"] [pl_accordion name="accordion"] [pl_accordioncontent name="accordion" number="1" heading="Contact Me By Email"]
This field is required. This field is required. This field is required. This field is required.
[/pl_accordioncontent] [pl_accordioncontent name="accordion" number="2" heading="Contact Me By Phone"] Call Me! [/pl_accordioncontent] [/pl_accordion] [/pl_modal]
[/code]

Share this post


Link to post
Share on other sites
Rob

My skillset hasn't yet reached to the level of some of our new shortcodes, so I can't tell whether your code is correct. However, I believe that you should simply upload your .js file to your site (preferably by FTP) then, link it in Dashboard > PageLines > Site Options > Custom Code > Header Scripts, or, you can just paste the javascript code directly in there. Editing template.header.php is not advised unless the section has been cloned inside Base Child Theme. I'll defer to my colleagues about the shortcode part of your post to determine if there's any errors since I can't validate it without a live link. You might be able to do that to see if there are any errors, but I'd suggest applying the change above and fixing/restoring the template.header.php before validating.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
ging

I changed the header and put in the code in Custom Code. Same results. Please keep me posted.

Share this post


Link to post
Share on other sites
ging

Anyone have any idea! Any help would be appreciated I'd like to get my site live and ready to go by tonight and this is the only thing stopping me from doing that.

Share this post


Link to post
Share on other sites
Danny

Hi, Make suer you followed Rangelone's advice and remove the code you added to header.php. You shouldn't really edit the core files, as strange things may happen. If adding the


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
beardedavenger

I'd probably hire someone to do this, or use a plugin instead. Scripts go in the Custom Code section just like explained above. You don't even have a file for the form to make the call too, so how is it going to send the mail?I'd recommend a plugin like Contact Form 7 so you don't have to do this manually. Nick


Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
ging

The form has always made the call to my php processor and works fine. I have fully functional forms at http://freteleven.com in the pl_modal. I just can't use the javascript in the modal to validate the form and send it via ajax. I understand that i can use a plugin and I dont' have to do it manually but I like the look of the bootstrap form elements and I would like to validate the forms and send them using ajax with jquery. My .js file loads according to firebug, but I can't call any of the jquery functions from within the modal.

Share this post


Link to post
Share on other sites
Danny

Maybe there is a js conflict, can you provide a link to the site where you got the code from. I don't personally know javascript but posting it here will help our team diagnose the issue.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×