For future reference, the algorithm is this:
1. Create a shader that draws no real pixels, but instead writes all non-transparent pixels to the stencil buffer with an int value between 1 and 255. That int value is passed in as a parameter to the shader, so the texture that is passed in along with that int is just used to determine where there are non-transparent pixels. This would let you create non-rectangular stencils. If you just wanted rectangles, you could do a version that doesn't have to pass a texture along the GPU pipeline.
2. Create another shader that is just like the normal diffuse shader -- the most basic kind available that just renders a texture in true color with an optional diffuse applied to it. However, this one uses Equal and an int passed in. So whenever this new shader is used, it will only render pixels that actually match a place in the stencil buffer
3. Any time you want a clipping area, render a texture using the stencil shader to the area that you want to be the "you can only draw here" area for a future draw call. Give this a unique number (for this render pass) ranging from 1 to 255.
4. Then when you want to draw the thing(s) to be clipped into that area, use the shader from #2 to do it, and pass in that same integer you used in #3. They will be magically clipped to that area, but nothing else will.
Using that approach, you could have up to 256 clipped areas onscreen at once for textboxes, scrolling areas, whatever. It would be quite light on the GPU, too.