PDA

View Full Version : Input type=text fields wrap when JSpell attached


charris
11th February 2008, 04:13 AM
We find that ordinary text fields wrap when JSpell is attached. this is a problem for us as it make sit difficult to work out what you may have entered in the field and can't see the entire contents at once.

Also - if there are line breaks - when the value is saved - only the first line is saved.

staff
12th February 2008, 12:37 AM
There is presently no facility to limit the length of the input field. Also, line breaks are not permitted for HTML input fields, therefore when JSpell persists the values back to the input field you lose the 2nd line of input... you may be able to prevent this by trapping Enter keypresses on your document.

hamiltd1
15th September 2008, 05:59 PM
We've run into this problem now

function jspellPostInit()
{
var txtarea = document.getElementsByName("myTextElement");
if (txtarea.length>0) {
var jspellEditorObj=
jspellAreaLookup(document.getElementById("myTextElement")).contentWindow.document;
jspellAddEventListener(jspellEditorObj,"keyup",myEventHandler);
}
}

function myEventHandler(_ev)
{
alert(_ev.keyCode);
if(_ev.keyCode=='13')
{
alert('you pressed enter');
}
}

We get that the event keycode is empty, what do we need to use to get the key code pressed? I've tried debugging it some but I don't seem to be having luck with this.

Thanks,
David Hamilton