|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Thu Jun 17, 2004 1:37 am Post subject: datepick and -'s |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jun 17, 2004 1:44 am Post subject: |
|
|
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 |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Thu Jun 17, 2004 1:52 am Post subject: Cuz |
|
|
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 |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Thu Jun 17, 2004 1:55 am Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jun 17, 2004 1:56 am Post subject: |
|
|
Yeah, I know that--but the issue is a javascript one |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Thu Jun 17, 2004 1:56 am Post subject: |
|
|
Yup, the plugin should output javascript that works with names that contain hyphens, etc. (see post #4). |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jun 17, 2004 1:59 am Post subject: |
|
|
Ahh, if that is generated code, then my bad.
Thanks for straightening me out on that |
|
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
|