|
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 |
truemaster Smarty n00b
Joined: 08 Mar 2019 Posts: 2
|
Posted: Fri Mar 08, 2019 9:28 am Post subject: Selectfeld mit Jahr Monat Datum |
|
|
Hallo zusammen,
kann mir jemand sagen, wie ich mit einer Schleife zb die Jahre in einem Formular in Select packen kann? Also zB Startjahr und Endjahr. Muss das Selectfeld so haben, damit ich es noch mit CSS stylen kann.
Meine ganzen Ansätze klappen nicht. Selbst, wenn ich die Daten in ein Array packen möchte siehe Bsp.
Code: |
$iTag = 1;
while ($iTag <= 31)
{
$hallo[] += $iTag;
$iTag++; // es wird $i in Array gepackt
// Wert wird um 1 erhöht
}
$smarty->assign('test',$hallo);
|
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Mar 08, 2019 5:49 pm Post subject: |
|
|
Use an actual calendar library. There's plenty available in JS.
Your approach simply can not work, not supposed to.
Also, this is not a Smarty question. |
|
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
|