still doesn't work :( can't go back to normal
On Apr 23, 5:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Try using this code instead: > > function makeReadOnly(a) { > if ($("a:contains('disabled')")) { > $(a).attr("disabled","disabled"); > } > else { > $(a).removeAttr("disabled"); > } > } > > On Apr 22, 7:37 pm, Andri <[EMAIL PROTECTED]> wrote: > > > instead of making it readonly, i try to disabled it > > > function makeReadOnly(a) { > > if ($("a:contains('disabled')")) { > > $(a).attr("disabled","disabled"); > > } > > else { > > $(a).removeAttr("disabled","disabled"); > > } > > } > > > If i check the checkbox, the input text become disabled, but when i > > checked it again, it won't be normal again. > > anything wrong? > > > On Apr 23, 12:10 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > > Use the attr function > > > > On Apr 22, 3:19 pm, Andri <[EMAIL PROTECTED]> wrote: > > > > > Hi, I'm newbie here > > > > > there is two input form, checkbox and text. i want if I checked the > > > > chekbox, the input text will become readonly, and if i checked again, > > > > the input text back to normal. I'm trying make this function > > > > > function makeReadOnly(a) { > > > > if ($("a:contains('readonly')")) { > > > > $("readonly = 'readonly'").replaceWith(" "); > > > > } > > > > else { > > > > $(a).append("readonly = 'readonly'"); > > > > } > > > > } > > > > > but its not working. firebug says that replaceWith is not a function. > > > > > anybody can help me out?