 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
mto Smarty n00b
Joined: 22 Apr 2003 Posts: 1
|
Posted: Tue Apr 22, 2003 12:13 pm Post subject: using a smarty variable as an argument for a javascript func |
|
|
I'd like to use a smarty variable as an argument for a javascript function.
I wrote something like that but it don't works :
<input type='text' size='10' value='{$smarty.now|date_format:"%d/%m/%Y"}' name='txtText'>
<input type='button' value='OK' onClick='fctTest(txtText.value,{literal}{$dateWriter}{/literal})'>
here is the message :
missing : after property id
fctTest(txtText.value,{$dateWriter})
What is wrong ? |
|
| Back to top |
|
dthought Smarty Regular
Joined: 21 Apr 2003 Posts: 55 Location: Melbourne, Australia
|
Posted: Tue Apr 22, 2003 12:45 pm Post subject: |
|
|
Wrong way around... you use {literal} when you have JavaScript that uses curly braces (so Smarty doesn't try to pick them up as Smarty tags).
Remove the literal tags and you should be fine. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|