Limiting Textarea Length

I thought I'd share a sort of plug and play solution to text area length controls that I've been abusing. All credit here goes to Roy Jin, the original developer. I just thought I'd share what a good tool it was, and the $(document).ready() code you need to be up and running. You can pick up the jquery Textarea Counter on his site, as well as look up docs for tweaking things.

Post from Form inside Form

I've got a mass edit form for orders on one of the sites I work on. But each order needed link or button to track the shipments of that order using UPS. Well, today we added FedEx tracking as well. UPS was easy, they do everything via url, so a simple link worked fine. FedEx, not so much, you have to post everything over to them. Obviously that creates a sort of form within a form, and that's not valid html. Javascript becomes required, here's your setup:

Tags: 

Javascript Global Regex Match

I needed to do a case insensitive, multiline, global regex (/img) over some html. The matches kept coming back wrong using $.each() and Mozilla's directions. The while loop on the Mozilla docs site didn't work for me, every time it returned match as "true." That's no help, of course. So, a do while loop instead, and all is well.

Jquery Table Auto Row

Another one mostly for myself, part of a larger picture I'm putting together. This small little javascript object will make it so any table you add a class of "auto-row" will have fun new behaviors. When any select, input, or textarea element in the last row changes, the row is duplicated and added right below. All digits in patterns "like" [##]" are automatically incremented for you before they are attached to the DOM. The row you were editing looses it's special behavior, and the newly inserted row is prepared to do the same.

Pages

Subscribe to Fragmented Thought RSS