AJAX TextBoxWatermarkExtender calls the extension of the textbox it is attached to

Here's a benchmark test. I have multiple text boxes (multiline, wrap = true) with watermark additions attached.

then I type a short world, then a space, then a long word (for example, "short longggggggggggggggggggggggggggggg" which consumes more line to make the scrollbar appear)

whenever I set focus to another textbox, then set it back to the watermarked textbox, the latter becomes more and more spontaneous making the entire page look ugly.

The problem only occurs in IE, Firefox does the same.

Text fields without a watermark and watermarked but disabled (property "enabled = false") also behave normally.

Google is silent on this issue, I have not found even vague advice. Obviously there is something wrong with the AJAX javascript, but how do I fix it? Are there solutions but getting rid of the watermarks?

Somebody knows?

thanks.

0


a source to share


1 answer


Initially I ran into a problem and there were no obvious fixes. The problem seems to be related to CSS.

In my case, I had something like the following pseudocode.

<td>
    <asp:textbox id="tbDescription" multiline="true" cssClass="tbMultiline" ..other attributes excluded for brevity />
    <asptoolkit:TextboxWatermarkExtender targetControlId="tbDescription" WatermarkCSS="tbMultilineWatermark" message="blah blah blah" ..other attributes excluded.../>
</td>

      



both css classes set the width to 100%. However, the bounding TD did not have a fixed width, and therefore would exhibit the extended behavior that you saw.

I fixed the problem by forcing the width to a fixed%.

0


a source







All Articles