Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

datepick and -'s

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Thu Jun 17, 2004 1:37 am    Post subject: datepick and -'s Reply with quote

This doesn't work:

<input type="textbox" name="values-1-date">

<a href="javascript:void(0)" onclick="javascript:datepick('default',document.myform.values-1-date)"><img src="/smarty_datepick/images/default/cal_icon.gif" border=0></a>

hyphens (-) are supposedly valid for ID and NAME attributes:
http://jscript.dk/faq/php.asp
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Jun 17, 2004 1:44 am    Post subject: Reply with quote

Hey gerard. So why are you telling us about it? It appears to contain 0% Smarty content.

Also, why not just continue the thread you already started on this topic of datepick?
Back to top
View user's profile Send private message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Thu Jun 17, 2004 1:52 am    Post subject: Cuz Reply with quote

Cuz it's a smarty plugin, authored by morht.
http://smarty.php.net/contribs/plugin-apps/datepick-README.txt

This fixes it - works on both IE and Firefox:

<input type="textbox" name="values-1-date">

<a href="javascript:void(0)" onclick="javascript:datepick('default',document['myform']['values-1-date'])"><img src="/smarty_datepick/images/default/cal_icon.gif" border=0></a>

Even works with form arrays.
Back to top
View user's profile Send private message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Thu Jun 17, 2004 1:55 am    Post subject: Reply with quote

Fix for datepick plugin:

Code:
// text field
      echo '<a href="javascript:void(0)" onclick="javascript:datepick(\''.$theme.'\',document[\''.$form.'\'][\''.$field.'\'])"><img src="/smarty_datepick/images/'.$theme.'/cal_icon.gif" border=0></a>';


The other two options (for dropdowns) likely need similar changes.


Last edited by gerard on Thu Jun 17, 2004 2:03 am; edited 2 times in total
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Jun 17, 2004 1:56 am    Post subject: Reply with quote

Yeah, I know that--but the issue is a javascript one Wink
Back to top
View user's profile Send private message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Thu Jun 17, 2004 1:56 am    Post subject: Reply with quote

Yup, the plugin should output javascript that works with names that contain hyphens, etc. (see post #4).
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Jun 17, 2004 1:59 am    Post subject: Reply with quote

Ahh, if that is generated code, then my bad.

Thanks for straightening me out on that Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP