$("[EMAIL PROTECTED]").each(function(i){
this.append("<textarea name='" + this.attr("name") + "'>" + this.val()
+ "</textarea>").remove()
})

is a bit shorter... and throwing the remove at the end of the chain
will save you a small fraction of a millisecond!

I just took Glen's code and shortened it. I've used the append and
remove before.

On 2/23/07, Glen Lipka <[EMAIL PROTECTED]> wrote:
> I havent tested, but this is in the ballpark I think:
> $("[EMAIL PROTECTED]").each(function(i){
>
> currentName = this.attr("name");
>  currentValue = this.val();
>  this.append("<textarea name='" + currentName + "'>" + cuurentValue +
> "</textarea>;
>  this.remove
> ();
> });
> So this would destroy the input and replace with textarea.
> There might be a better way, but I "think" this should work.
>
> Glen
>
>
>
> On 2/23/07, Brian Miller <[EMAIL PROTECTED]> wrote:
> > I need to replace a whole lot of <input type="text"> elements on a page
> > with <textarea> elements.  (I have limited control over how the fields are
> > generated.)  The contents of the form fields must remain - I just want to
> > change the "shape" of the field to make it bigger and allow multiline
> > input.
> >
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>


-- 
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to