date enable disable
- by Newbie
I have an "add new product page" and I have a field in the database table "jos_stockmovement", "start_week" which contains data for the year and week.
In my "Add New Product" page I have a field dropdown-list named "Start Week" which holds the year and week, for example, "2012/36".
How do I disable the past week? I all I want to enable is the current week.
Heres my code:
<td colspan="99">
<%= fld.select :start_week, options_for_select(
StockMovement.order("year DESC, week DESC").map { | val |
[ "#{ val.year }/#{ val.week }", val.id ]
},
:selected => @product.start_week
),
:class => "ddl_SW"
%>
</td>