Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can include javascript in .tpl file?
JavaScript
window.onload = function () {
    var oTextbox = new AutoSuggestControl(document.getElementById("txt1"), new StateSuggestions());
}
Posted
Updated 22-May-18 1:02am
v2
Comments
ahmed559 17-May-12 14:51pm    
no,this is smarty enabled .tpl file.So we don't able to include java script as
<script type="text/javascript">
// Your script here.
</script>

<script type="text/javascript">
{literal}
window.onload = function () {
var oTextbox = new AutoSuggestControl(document.getElementById("txt1"), new StateSuggestions());
}
{/literal}
</script>
 
Share this answer
 
Isn't a .tpl file basically just HTML with some points where to insert additional stuff? If yes, then you should be able to do this:

HTML
<script type="text/javascript">
// Your script here.
</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900