Hello, if you define your Javascript function in your "html.erb" (and not on a external file) you could just use <%= ... %> to access ruby predefined variables and on ruby you would write that code in to a string and then use it.
but the calendar_date_select controle pretty much covers all the javascript needed for it to work...you just have to put it one the page. regs. On Wed, Mar 31, 2010 at 9:04 AM, Hemant Bhargava <li...@ruby-forum.com>wrote: > Colin Law wrote: > > On 31 March 2010 06:43, Hemant Bhargava <li...@ruby-forum.com> wrote: > >> how should i do this in javascript.. I am little bit confused.. > > I have not used calendar_date_select but I imagine it is already using > > javascript to do the popup. Have a look at the html of your page and > > see what is there. (View, Page Source or similar in browser). > > > > Colin > > Source code for line > > <%= calendar_date_select :abc, :def, :year_range => > 1.years.ago..1.years.since, %> > > is as:- > > <input id="abc_def" type="text" value="" size="30" name="abc[def]"/> > <img class="calendar_date_select_popup_icon" style="border: 0px none ; > cursor: pointer;" > src="/abc/images/calendar_date_select/calendar.gif?1266227981" > onclick="new CalendarDateSelect( $(this).previous(), {year_range:[2009, > 2011]} );" alt="Calendar"/> > > How should i write this code in javascript.. I tried it but fails.. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.