If you need to have a lot (hundreds) of textboxes on a form with as-you-type enabled - it may be best to use regular text boxes along with 1 as-you-type enabled inline textbox. By moving the inline text box over the regular text boxes, we can achieve the same effect as having all inline text boxes, with less browser load. Please try this example and note the addition of onfocus handlers in the regular text boxes, which is the only per textbox addition. <%@ taglib uri="/WEB-INF/RapidSpellWeb.tld" prefix="RapidSpellWeb" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script> function itb_blur(){ inlineTB.custom_shadow.value=inlineTB.GetText(); } function tb_focus(tb){ rsw_updatePosition(inlineTB._getTBS().iframe, tb); var w = rsw_getElementWidth(tb.id); var h = rsw_getElementHeight(tb.id); if((document.compatMode && document.compatMode!="BackCompat") || navigator.userAgent.indexOf("Gecko")>-1)//correct width when in strict mode { w = rsw_adjustOffsetWidthForStrict(inlineTB._getTBS().iframe, w); h = rsw_adjustOffsetHeightForStrict(inlineTB._getTBS().iframe, h); } inlineTB._getTBS().iframe.style.width = w+"px"; inlineTB._getTBS().iframe.style.height = h+"px"; inlineTB._getTBS().iframe.style.backgroundColor = "white"; inlineTB.custom_shadow = tb; rsw_copyComputedStyle(inlineTB._getTBS().ifDoc.body, tb); inlineTB.SetText(tb.value); inlineTB.Focus(); inlineTB._getTBS().spellChecker.OnSpellButtonClicked(); } var inlineTB; function RS_OnTextBoxesInitialized(){ inlineTB = ta_JSObj; inlineTB.OnBlur = itb_blur; inlineTB.OnCorrection = itb_blur; } </script> </head> <body> <form name='f1'> <p> <textarea id="tb1" name="tb1" rows=14 cols=30 onfocus="tb_focus(this)" >textbox nummber 1</textarea> <textarea id="tb2" name="tb2" rows=14 cols=30 onfocus="tb_focus(this)" >boxx 2</textarea><br /> <textarea id="tb3" name="tb2" rows=14 cols=60 onfocus="tb_focus(this)" >boxx 3</textarea> <RapidSpellWeb:rapidSpellWInline id="rswi" textComponentID="ta" rapidSpellWInlineHelperPage="rswihelper.jsp" checkAsYouType="true" /> <RapidSpellWeb:rapidSpellWInlineTextBox id="ta" width="1" height="1" stylePosition="absolute" styleLeft="-5" styleTop="-5" /> </p> </form> </body> </html> |