I got a quick one... I've been trying to figure it out myself but haven't been able to come up with anything that works fully.
I want to prepend some text inside a textbox and force it at all times. I don't want the user to be able to remove the prepended text in any way but still allow them to add text after it.
Do you want it submitted with the textbox contents, or merely there to serve as a prompt for the person filling in the textbox?
Originally Posted by KDLA
What I'd do is "fake" an inset textbox, with absolute positioning, then apply sufficient padding to prevent the person typing over the text.
Also, I've used background images as "text" w/ padding, too.
But, that's from my designer's perspective.
I wish I could do that. But the prepended text will be different all the time. I could do a background image with the GD library in PHP but I feel that would over-complicate things for this particular usage.
I've tried this but it doesn't work totally...
When you delete all the text in the textbox the "Test: " part shows up a second time. Not sure why. If you can try it yourself you'll see what I mean.
jQuery(this).val('Test: ' + jQuery(this).val().replace('Test: ', ''));
Also, that may not be the best way to do it...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread