I declare some checkboxes : <%= check_box_tag ''offers[]'', offer.id , @params[:offers].include?(offer.id.to_s) ,:readonly=>true %> the result is : <input checked="checked" id="offers[]" name="offers[]" readonly="readonly" type="checkbox" value="1" /> But readonly doesn''t work ??? -- Posted via http://www.ruby-forum.com/.
daniel wijnands wrote:> > I declare some checkboxes : > > <%= check_box_tag ''offers[]'', offer.id , > @params[:offers].include?(offer.id.to_s) ,:readonly=>true %> > > the result is : > > <input checked="checked" id="offers[]" name="offers[]" > readonly="readonly" type="checkbox" value="1" /> > > But readonly doesn''t work ???Hi, this site might be of some use to you: http://www.htmlcodetutorial.com/forms/_INPUT_DISABLED.html In a nutshell it explains that READONLY only prevents users from changing the VALUE. i.e. the user can still interact with the checkbox. Perhaps DISABLED is what you''re looking for. Ali -- Posted via http://www.ruby-forum.com/.
disabled doesn''t get posted in the browser, readonly does. so i need readonly, i want the values but they cannot edit them :) Ali Hamidi wrote:> daniel wijnands wrote: >> >> I declare some checkboxes : >> >> <%= check_box_tag ''offers[]'', offer.id , >> @params[:offers].include?(offer.id.to_s) ,:readonly=>true %> >> >> the result is : >> >> <input checked="checked" id="offers[]" name="offers[]" >> readonly="readonly" type="checkbox" value="1" /> >> >> But readonly doesn''t work ??? > > Hi, > > this site might be of some use to you: > http://www.htmlcodetutorial.com/forms/_INPUT_DISABLED.html > > In a nutshell it explains that READONLY only prevents users from > changing the VALUE. i.e. the user can still interact with the checkbox. > Perhaps DISABLED is what you''re looking for. > > Ali-- Posted via http://www.ruby-forum.com/.
With what i understand a readonly property works with textbox & textarea and all but not with a checkbox, if u want to make the checkbox non editable by the user u have to make the disabled property true, to still get the value either have a hidden input or make the disabled property false onsubmit On Wed, 2005-12-21 at 12:34 +0100, daniel wijnands wrote:> disabled doesn''t get posted in the browser, readonly does. > so i need readonly, i want the values but they cannot edit them :) > > > > Ali Hamidi wrote: > > daniel wijnands wrote: > >> > >> I declare some checkboxes : > >> > >> <%= check_box_tag ''offers[]'', offer.id , > >> @params[:offers].include?(offer.id.to_s) ,:readonly=>true %> > >> > >> the result is : > >> > >> <input checked="checked" id="offers[]" name="offers[]" > >> readonly="readonly" type="checkbox" value="1" /> > >> > >> But readonly doesn''t work ??? > > > > Hi, > > > > this site might be of some use to you: > > http://www.htmlcodetutorial.com/forms/_INPUT_DISABLED.html > > > > In a nutshell it explains that READONLY only prevents users from > > changing the VALUE. i.e. the user can still interact with the checkbox. > > Perhaps DISABLED is what you''re looking for. > > > > Ali > >