[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

select_date_helper

Josselin

6/30/2006 9:28:00 PM

this helper is not complete... there is nolink between month choice and
month_day..
so It's possible to select February 31st..
Is it impossible to modify it ?

joss

2 Answers

Jonathan Heinen

7/1/2006 5:02:00 PM

0

Josselin schrieb:
> this helper is not complete... there is nolink between month choice and
> month_day..
> so It's possible to select February 31st..
> Is it impossible to modify it ?
>
> joss
>

if you want to something like that you have write JavaScript Code to
observe the month field and update the possible choices acording to the
selected month ... You have to decide what will happen if some one
select the 30 of January and change to February will you change the date
to 28 of Feb? and to 29 if Feb in this month has 29 days!? It's a lot of
JavaScript Code you need and It'will only work if JavaScript is enabled ...

I think you can validate the dates when they arraive the server and send
an error if the date isn't valid!

Jonathan

Josselin

7/3/2006 5:51:00 AM

0

On 2006-07-01 19:01:57 +0200, Jonathan Heinen
<Jonathan.Heinen@rwth-aachen.de> said:

> Josselin schrieb:
>> this helper is not complete... there is nolink between month choice and
>> month_day..
>> so It's possible to select February 31st..
>> Is it impossible to modify it ?
>>
>> joss
>>
>
> if you want to something like that you have write JavaScript Code to
> observe the month field and update the possible choices acording to the
> selected month ... You have to decide what will happen if some one
> select the 30 of January and change to February will you change the
> date to 28 of Feb? and to 29 if Feb in this month has 29 days!? It's a
> lot of JavaScript Code you need and It'will only work if JavaScript is
> enabled ...
>
> I think you can validate the dates when they arraive the server and
> send an error if the date isn't valid!
>
> Jonathan

thanks for your comments, I thought that in web 2.0, Ajax could be
helpful sending back a day select according to user selection ? but
you're right about client JS vs server checking ...

joss