I'm still learning my way through Umbraco/XSLT. I created a xslt macro, for a form, which has some kind of date pickers made with select tags from HTML. Now I want to create some kind of loop that checks all the (option) from my select, and if the (option) matches the current month, that (option) is the "selected" one.
So, what I am aiming for here is:
- get the current month (Already achieved this ); - loop through all the 12 month (option); - If (option value="currentMonth"), then selected="selected"
Creating some kind of "for-loop"
Hello guys,
I'm still learning my way through Umbraco/XSLT.
I created a xslt macro, for a form, which has some kind of date pickers made with select tags from HTML.
Now I want to create some kind of loop that checks all the (option) from my select, and if the (option) matches the current month, that (option) is the "selected" one.
So, what I am aiming for here is:
- get the current month (Already achieved this );
- loop through all the 12 month (option);
- If (option value="currentMonth"), then selected="selected"
Thank you in advance!
Hi Gonçalo,
Here's how I'd probably start:
Hope that gets you started too,
/Chriztian
That worked well!
Thank you Chriztian
is working on a reply...