cian1991ferrari Posted June 28, 2010 Share Posted June 28, 2010 Hi everyone, I've written a few functions and checks to validate credit card form information. My problem is they're in PHP and in order for them to check the fields, I must let users submit the form which cause some problems and isn't too secure. I'm proposing of writing an external JavaScript page with a validate function but I don't know how to use the JavaScript in templates. I'm thinking of putting the validate() function to occur when the submit is clicked such as: and obviously must call the JS page in header section but is there other stuff I have to know such as special tags? Link to comment Share on other sites More sharing options...
bartman Posted June 28, 2010 Share Posted June 28, 2010 you can wrap javascript in .tpl files so it executes normallyas follows {literal} javascript here {/literal} Link to comment Share on other sites More sharing options...
andy T Posted June 29, 2010 Share Posted June 29, 2010 do you know if it is possible to add JS or CSS through a TPL so it gets included in the header, I noticed the folling code but am not sure how it is executed. {if isset($js_files)} {foreach from=$js_files item=js_uri} [removed][removed] {/foreach} {/if} Link to comment Share on other sites More sharing options...
kingsinnersoul Posted September 27, 2011 Share Posted September 27, 2011 is there any finite answer regarding how to add JS in a tpl file? thanks Link to comment Share on other sites More sharing options...
NelsonR Posted October 27, 2011 Share Posted October 27, 2011 The {literal} tags don't work... 1 Link to comment Share on other sites More sharing options...
vitochueng Posted April 21, 2014 Share Posted April 21, 2014 Thanks a lot! The {literal} tags works for me. I'm using ps 1.6... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now